# -*- coding: utf-8 -*-
from itertools import accumulate
def inpl(): return map(int, input().split())

N, K, Q = inpl()
A = input()

S = sorted(map(int, A.split()))
ans = S[Q-1] - S[0]
S = S[::-1]
Que = [A]


while True:
    s = S.pop()
    nQ = []
    OK = 0
    for q in Que:
        for r in (" "+q).split(" {} ".format(s)):
            L = len(r.split())
            if L >= K:
                nQ.append(r)
                OK += (L - K + 1)
    if OK < Q:
        break
    tmp = []
    for q in nQ:
        tmp.extend(sorted([int(x) for x in q.split()])[::-1][K-1:])
    tmp = sorted(tmp)
    ans = min(ans, tmp[Q-1] - tmp[0])
    Que = nQ

print(ans)