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:
    # 一つしか選ばない -> max == min -> 0
    print(0)
    exit()
if Q == N - K + 1:
    print(L[0][1])
    exit()
if K == 1:
    # 一つずつ選べる -> 必ず最小のパターンに出来る
    print(sL[0][1])
    exit()

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()
    sL = [i for i in sL if i[0] <= m_index]
    # 最小値の幅が狭まるためsLを更新

if sL[0][0] == 0:
    # minが最小の時 最小のパターンになる時
    print(sL[0][1])
    exit()

if sL[0][1] == sL[len(sL)-1][1]:
    print(sL[0][1])
    exit()

m_key = max(sL,key=lambda x:x[0])[0]
for key,value in sL:
    if key >= m_key + K:
        continue
    f = True
    for b_key in range(key,key+Q):
        b_value = B[b_key]
        a_indeces = [i for i, x in enumerate(A) if x == b_value]
        success_count = min(len(a_indeces),key + Q - b_key)
        count = 0

        for a_index in a_indeces:
            length = 1
            tmp_length = 1
            for j in range(a_index-1,-1,-1):
                if j < 0:
                    break 
                if A[j] < B[key]:
                    break
                if B[key] <= A[j] <= b_value:
                    continue
                tmp_length += 1
                if tmp_length >= K:
                    break
            tmp_length -= 1
            for j in range(a_index+1,N):
                if j > N-1:
                    break 
                if A[j] < B[key]:
                    break
                if B[key] <= A[j] < b_value:
                    continue
                length += 1
                if length >= K:
                    break
            length += tmp_length
            if length >= K:
                count += 1
        if count < success_count:
            f = False
            break
        
    if f:
        print(value)
        exit()
    m_key = min(m_key,key)
    

print(L[0][1])
