from heapq import nsmallest


def add_list(s, t, new_lists, removals):
    l = t - s
    if l >= k:
        removals.extend(nsmallest(l - k + 1, aaa[s:t]))
        new_lists.append((s, t))


n, k, q = map(int, input().split())
aaa = list(map(int, input().split()))
srt = sorted(set(aaa))
lists = [(0, n)]
ans = float('inf')
for a in srt:
    new_lists = []
    removals = []
    for s, t in lists:
        for i, b in enumerate(aaa[s:t]):
            if a > b:
                add_list(s, s + i, new_lists, removals)
                s = s + i + 1
        add_list(s, t, new_lists, removals)
    if len(removals) < q:
        break
    ans = min(ans, nsmallest(q, removals)[-1] - a)
    lists = new_lists

print(ans)
