n,k,q = map(int,input().split())
# N: 処理する区間の長さ
N0 = 2**(n-1).bit_length()
INF = 2**31-1
data = [INF]*(2*N0)
a = list(map(int,input().split()))
for i in range(N0):
    data[i+N0] = a[i]
# a_k の値を x に更新
def update(k, x):
    k += N0-1
    data[k] = x
    while k >= 0:
        k = (k - 1) // 2
        data[k] = min(data[2*k+1], data[2*k+2])
# 区間[l, r)の最小値
def query(l, r):
    L = l + N0; R = r + N0
    s = INF
    while L < R:
        if R & 1:
            R -= 1
            s = min(s, data[R-1])

        if L & 1:
            s = min(s, data[L-1])
            L += 1
        L >>= 1; R >>= 1
    return s

ans = []
for i in range(q):
    res = INF
    for i in range(n-k+1):
        v = query(i,i+k)
        if res > v:
            res = v
            ind = i
        
    ans.append(res)
    update(i,INF)
    
        
        
    

print(max(ans) - min(ans))