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 = False
    C = [(i if i >= B[key] else None) for i in A]
    i = 0
    j = 0
    max_value = B[key + Q - 1]
    length = 0
    while i < N:
        if not C[i]:
            i += 1
            continue
        j = i + 1
        while j < N:
            if not C[j]:
                break
            j += 1
        tmp = (j-i) - K + 1
        if  tmp <= 0:
            i = j + 1
            continue
        if sorted(C[i:j])[tmp] < max_value:
            break
        length += tmp
        i = j +1
    if length >= Q:
        f = True
            

    if f:
        print(value)
        exit()
    m_key = min(m_key,key)
    

print(L[0][1])
