import heapq
N, K, Q = [int(_) for _ in input().split()]
A = [int(_) for _ in input().split()]
ans = float('inf')
for amin in sorted(set(A)):
    cand = []
    dp = []
    for i in range(N):
        a = A[i]
        if a >= amin:
            heapq.heappush(dp, a)
        if len(dp) and (a < amin or i == N - 1):
            m = len(dp) - K + 1
            for _ in range(m):
                heapq.heappush(cand, heapq.heappop(dp))
    y = float('inf')
    if len(cand) >= Q:
        for _ in range(Q):
            y = heapq.heappop(cand)
        ans = min(ans, y - amin)
print(ans)
