N, K, Q = map(int, input().split())
A = [int(a) for a in input().split()]

minSub = 10**10
for i in range(N):
    X = A[i]
    start = False
    end = 0
    subarray = []
    while  end < N:
        if not start and A[end] >= X:
            start = end
            smallarray = [A[end]]
        elif A[end] >= X: smallarray.append(A[end])
        elif start and A[end] < X:
            if end - start >= K:
                smallarray.sort()
                for j in range(len(smallarray) - K + 1):
                    subarray.append(smallarray[j])
            start = False
        end += 1
    if start:
        if end - start >= K:
            smallarray.sort()
            for j in range(len(smallarray) - K + 1):
                subarray.append(smallarray[j])
    if len(subarray) < Q: continue
    else: 
        subarray.sort()
        minSub = min(minSub, subarray[Q-1] - subarray[0])
print(minSub)