n,k,q = gets.split.map &:to_i
a = gets.split.map &:to_i
b = a.sort.uniq
c = 

ans = []
b.size.times{|i|
  x = b[i]
  cnt = 0
  que = []
  ya = []
  n.times{|j|
    que << a[j]
    if a[j] < x
      que.clear
    else
      ya << a[j]
    end
    cnt += 1 if k<=que.size
  }
  
  ans << ya.sort[q-1] - x if q<=cnt
}

p ans.min
