from itertools import groupby, chain
N, K, Q, *A = map(int, open(0).read().split())
ans = float("inf")
for Y in set(A):
    C = sorted(chain.from_iterable(v[:len(v) - K + 1] for v in (sorted(v) for k, v in groupby(A, key=lambda a: a >= Y) if k) if len(v) >= K))
    if len(C) >= Q:
        ans = min(ans, C[Q - 1] - Y)
print(ans)