# E
import heapq
import numpy as np

N, K, Q = map(int, input().split())
A = list(map(int, input().split()))

A_args = np.argsort(A)

nodeid = np.ones(N).astype("int32")
canput = np.ones(N)
nodeid_dict = dict()
nodeid_dict[1] = [0, N]
# initial output
res = A[A_args[Q-1]] - A[A_args[0]]

ind_del = 0

for i in range(N):
    
    nid = A_args[i]
    
    # update nodeid
    ndid = nodeid[nid]
    nodeid[nid] = 0
    left, right = nodeid_dict[ndid]
    nodeid[(nid+1):right] = i+2
    nodeid_dict[nid] = [left, nid]
    nodeid_dict[i+2] = [nid+1, right]

    # update canput
    canput[nid] = 0
    
    canput[left:nid] = 0
    h = []
    for j in range(left, nid):
        heappush(h, (-A[j], j))
    while len(h) >= K:
        _, j = heappop(h)
        canput[j] = 1
    
    canput[(nid+1):right] = 0
    h = []
    for j in range(nid+1, right):
        heappush(h, (-A[j], j))
    while len(h) >= K:
        _, j = heappop(h)
        canput[j] = 1
    
    # break
    if canput.sum() <= Q:
        break
        
    # calculate
    q = 0
    qmin = 10**9
    qmax = 1
    for i in range(N):
        if canput[A_args[i]] == 1:
            q += 1
            qmin = min(A[A_args[i]], qmin)
            qmax = max(A[A_args[i]], qmax)
            if q == Q:
                r = qmax - qmin
    res = min(res, r)
print(res)