n, k, q = map(int, input().split())
a = list(map(int, input().split()))
b = sorted(a)
ans = 10**9
# k=1(どこでも取り除ける)とき
# k>1では取り除けるかどうか考えるべき
removed = []
def check(removed, k, target):
    # target: 考慮する番号のindex
    if len(removed) == q:
        return True
    r = n-1
    l = 0
    for num in removed:
        if num > target and r > num:
            r = num
        elif num < target and l < num:
            l = num
    # print(removed, k, target, l, r)
    return r-l >= k

for i in range(q):
    removed.append(a.index(b[i]))

if q == 1:
    print(a[0])
else:
    for i in range(n-q+1):
        can_remove = check(removed, k, a.index(b[i+q-1]))
        if can_remove:
            tmp_ans = b[i+q-1]-b[i]
            # print(i, i+q-1, b[i+q-1], b[i], tmp_ans)
            if tmp_ans < ans:
                ans = tmp_ans
        removed.append(a.index(b[i+q-1]))
    print(ans)
