n, k, q = map(int, input().split())
a = list(map(int, input().split()))

from collections import deque

def slide_min(a):
    q = deque()
    max_num = 0
    max_ind = 0
    for i in range(len(a)):
        while q and a[q[-1]] >= a[i]:
            q.pop()
        q.append(i)
        if i - k + 1 >= 0:
            if max_num < a[q[0]]:
                max_num = a[q[0]]
                max_ind = q[0]
            if q[0] == i - k + 1:
                q.popleft()
    return max_ind

# 小さいものをとっていく場合
b = sorted(a)
ans1 = b[q-1] - b[0]


# 大きいものをとっていく場合
li = []
for i in range(q):
    remove_ind = slide_min(a)
    li.append(a[remove_ind])
    del a[remove_ind]
ans2 = max(li) - min(li)

print(min(ans1,ans2))