#N, K, Q = 2000, 1000, 1000
#as = (0...N).to_a.shuffle
N, K, Q = gets.split.map(&:to_i)
as = gets.split.map(&:to_i)

ia = N.times.map{|i|[i, as[i]]}.sort_by{|arr|arr[1]}
comp = []
N.times do |i|
    comp[ia[i][0]] = i
end
comp += [-1]

ans = Float::INFINITY
used = Array.new(N) + [true]
(N-Q+1).times do |i|
    if ia[i+Q-1][1] - ia[i][1] >= ans
        used[ia[i][0]] = true
        next
    end
    max_i = ((i+Q-1)...N).bsearch do |j|
        tmp = 0
        d = 0
        sum = 0
        (N+1).times do |k|
            if used[k]
                if d >= K
                    sum += tmp < d-K+1 ? tmp : d-K+1
                    break if sum >= Q
                end
                tmp = 0
                d = 0
            else
                d += 1
                tmp += 1 if comp[k] <= j
            end
        end
        sum >= Q
    end
    if max_i
        cand = ia[max_i][1] - ia[i][1]
        ans = cand if ans > cand
    end
    used[ia[i][0]] = true
end

puts ans