N,K,Q = map(int, input().split())
A = [int(i) for i in input().split()]
S = sorted(A)+[0]
A+=[0]
ans =[]
for i in range(N):
    if S[i]==S[i+1]:
        continue
    mi = S[i]
    L =[]
    kou=[]
    for y in range(N+1):
        if A[y]>=mi:
            kou.append(A[y])
        elif len(kou)<K:
            kou =[]
        else:
            L+=sorted(kou)[:len(kou)-K+1]
            kou =[]
    if len(L)<Q:
        continue
    L.sort()
    ans.append((L[Q-1]-mi))
print(min(ans))