from itertools import groupby, chain

N, K, Q, *A = map(int, open(0).read().split())

ans = float("inf")
for Y in set(A):
    G = (sorted(v) for k, v in groupby(A, key=lambda a: a >= Y) if k)
    C = list(chain.from_iterable(v[:len(v) - K + 1]for v in G if len(v) >= K))

    if len(C) >= Q:
        C.sort()
        X = C[Q - 1]
        ans = min(ans, X - Y)

print(ans)
