n,k,q=map(int,input().split())
A=[int(i) for i in input().split()]

ans=10**10

for m in set(A)|{0}:
    can=[]
    stc=0
    for i in range(n):
        if A[i]<m and i-stc>=k:
            can.extend(sorted(A[stc:i])[:i-stc-k+1])
            stc=i+1
        elif A[i]<m:
            stc=i+1
    i+=1        
    
    if i-stc>=k:
        can.extend(sorted(A[stc:i])[:i-stc-k+1])
    
    if len(can)>=q:
        ans=min(ans,can[q-1]-can[0])
    #print(m,can)

print(ans)
        
        

