n, k, q = gets.chomp.split(' ').map(&:to_i)
array = gets.chomp.split(' ').map(&:to_i)
sorted_array = array.sort
answer = 1_000_000_000

sorted_array.each do |i|
  r = 0
  candidate_array = []
  while r < n
    index = array[r...n].index { |v| v < i } || n
    candidate_array += array[r, index].sort.first(index - k + 1) if index + 1 > k
    r += index + 1
  end
  break if candidate_array.size < q
  candidate_array.sort!
  answer = [answer, candidate_array[q-1]-candidate_array[0]].min
end
puts answer