N,K,Q = map(int,input().split())
A = list(map(int,input().split()))
B = sorted(A)
L = [[i,B[i+Q-1] - B[i]] for i in range(N-Q+1)]
sL = sorted(L,key=lambda x:x[1])

if Q == 1:
    print(0)
    exit()
if Q == N - K + 1:
    print(L[0][1])
    exit()
if K == 1:
    print(sL[0][1])
    exit()
if sL[0][0] == 0:
    print(sL[0][1])
    exit()

m_index = len(A)-1
a = A[N-K-Q+1:K+Q-1]
if a:
    m_index = B.index(min(a))
    if m_index == 0:
        print(L[0][1])
        exit()
    sL2 = [i for i in sL if i[0] <= m_index]
    print(sL2[0][1])
    exit()
print(L[0][1])
