#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

ans = Float::INFINITY
used = Array.new(N)
N.times do |i|
    max_i = ((i+Q-1)...N).bsearch do |j|
        result = true
        t = 0
        d = 0
        N.times do |k|
            if used[k]
                if t > d - K + 1
                    result = false
                    break
                else
                    t = 0
                    d = 0
                end
            end
            d += 1
            t += 1 if comp[i] <= j
        end
        result
    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