import sys
input = sys.stdin.readline
from heapq import merge

n, k, q = map(int, input().split())
A = list(map(int, input().split())) + [-1]
ans = float("inf")
for a in A:
  L = []
  S = []
  for t in A:
    if t >= a:
      L.append(t)
    else:
      L.sort()
      S.append(L[:max(len(L)-k+1, 0)])
      L = []
  K = list(merge(*S))
  if len(K) < q:
    continue
  y = K[q-1]
  ans = min(ans, y-a)
print(ans)