N,K,Q = map(int,input().split())
A = list(map(int,input().split()))
B = sorted(A[:])
ans = B[Q-1]-B[0]
for i in range(N-(K+Q-1)+1):
    B = A[i:i+K+Q-1]
    bmin = min(B)
    bmax = max(B)
    ans = min(ans,bmax-bmin)
print(ans)