N, K, Q = map(int, input().split())
A = list(map(int, input().split()))
sortedA = sorted(set(A))
ans = []
for v in sortedA:
    C = [[]]
    for i, t in enumerate(A):
        if t < v  and len(C[-1]) > 0 :
            C.append([])
        if t >= v :
            C[-1].append(t)
    tmp = []
    for t in C:
        if len(t) >= K:
            tmp += sorted(t)[:len(t)-K+1]
    if len(tmp) >= Q:
        ans.append(tmp[Q-1] - v)
print(min(ans))