n,k,q = gets.split.map &:to_i
a = gets.split.map &:to_i

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

p ans.min
