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