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

Bs = [(As[i], i) for i in range(N)]
Bs.sort()

orders = [-1] * N
for order, (B, i) in enumerate(Bs):
    orders[i] = order

ans = float('inf')
for C in range(N - Q - K + 2):
    Nos = [-1] * N
    lens = []
    No = 0
    le = 0
    for i in range(N):
        if orders[i]  < C:
            lens += [le]
            No += 1
            le = 0
        else:
            Nos[i] = No
            le += 1

    lens += [le]

    if lens[Nos[C]] < K: continue

    num = 0
    Y = Bs[C][0]
    for B, i in Bs[C:]:
        if lens[Nos[i]] >= K:
            lens[Nos[i]] -= 1
            num += 1
            if num == Q:
                ans = min(ans, B - Y)
                break

print(ans)
