import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
from itertools import groupby
def resolve():
    n, k, q = map(int, input().split())
    A = list(map(int, input().split()))
    B = sorted(A)

    ans = INF
    for i, m in enumerate(B):
        score = 0
        for key, it in groupby([a >= m for a in A]):
            if key is False:
                continue
            l = sum(1 for _ in it)
            score += max(0, l - k + 1)

        if score >= q:
            ans = min(ans, B[i + q - 1] - m)

    print(ans)
resolve()