local mfl, mce = math.floor, math.ceil
local mmi, mma = math.min, math.max
local bls, brs = bit.lshift, bit.rshift

local n, k, q = io.read("*n", "*n", "*n")
local a = {}
local b = {}
local used = {}
for i = 1, n do
  a[i] = io.read("*n")
  b[i] = i
  used[i] = false
end
table.sort(b, function(x, y) return a[x] < a[y] end)

local ret = a[b[q]] - a[b[1]]
for i = 1, n do
  local topidx = b[i]
  used[topidx] = true
  local tmp = {}
  local cand = {}
  for j = 1, n do
    if used[j] then
      table.sort(tmp)
      for z = 1, #tmp - k + 1 do
        table.insert(cand, tmp[z])
      end
      tmp = {}
    else
      table.insert(tmp, a[j])
    end
  end
  table.sort(tmp)
  for z = 1, #tmp - k + 1 do
    table.insert(cand, tmp[z])
  end
  if #cand < q then break end
  table.sort(cand)
  ret = mmi(ret, cand[q] - cand[1])
end
print(ret)
