N, K, Q = map(int, input().split())
A = list(map(int, input().split()))

def getMinX(i, y):
    B = [[]]
    for j, a in enumerate(A):
        if i == j:
            continue
        if a < y and len(B[-1]) > 0:
            B.append([])
        if a >= y:
            B[-1].append(a)

    C = []
    for grp in B:
        grp.sort()
        C += grp[:len(grp) - K + 1]
    C.sort()
    return C[Q - 2] if len(C) >= Q - 1 else 10**18

ans = 10**18
for i, y in enumerate(A):
    ans = min(ans, getMinX(i, y) - y)
print(ans)