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

ans = []
c.size.times{|i|
  x = c[i]
  cnt = 0
  s = []
  n.times{|j|
    s << a[j]
    s.clear if a[j] < x
    cnt += 1 if k<=s.size
  }
  idx = b.index(x)
  ans << b[idx+q-1]-b[idx] if b[idx+q-1] && q<=cnt
}

p ans.min
