import heapq

N, K, Q = map(int, input().split())
A = list(map(int, input().split()))

N0 = 2**(N-1).bit_length()
INF = 2**31-1
seg_min = [INF]*(2*N0)
seg_min_idx = [0] * (2 * N0)


def update(idx, value):
    idx += N0 - 1
    seg_min[idx] = value
    seg_min_idx[idx] = idx
    while idx > 0:
        idx = (idx - 1) // 2
        seg_min[idx] = min(seg_min[idx * 2 + 1], seg_min[idx * 2 + 2])
        seg_min_idx[idx] = seg_min_idx[idx * 2 + 1] if seg_min[idx * 2 + 1] <= seg_min[idx * 2 + 2] else seg_min_idx[idx * 2 + 2]


def query(first, last):
    first += N0 - 1
    last += N0 - 1
    ret = INF
    min_idx = 0
    while first <= last:
        if not first & 1:
            if seg_min[first] < ret:
                min_idx = seg_min_idx[first]
            ret = min(ret, seg_min[first])
        if last & 1:
            if seg_min[last] < ret:
                min_idx = seg_min_idx[last]
            ret = min(ret, seg_min[last])
        first = first // 2
        last = last // 2 - 1
    min_idx -= (N0-1)
    return ret, min_idx


for i, x in enumerate(A):
    update(i, x)

A_index = []
left_right_used = []
for i, x in enumerate(A):
    A_index.append((x, i))
    left_right_used.append([i, i, 0])
A_index.sort(key=lambda a: a[0], reverse=True)

pq = []
ans = 10 ** 10
for i in range(N):
    left_used_flag = 0
    right_used_flag = 0
    index = A_index[i][1]
    left_right_used[index][2] = 1
    if index - 1 >= 0:
        if left_right_used[index - 1][2] == 1:
            left_used_flag = 1
    if index + 1 < N:
        if left_right_used[index + 1][2] == 1:
            right_used_flag = 1
    if left_used_flag == 1 and right_used_flag == 1:
        leftmost = left_right_used[index - 1][0]
        rightmost = left_right_used[index + 1][1]
    elif left_used_flag == 1 and right_used_flag == 0:
        leftmost = left_right_used[index - 1][0]
        rightmost = index
    elif left_used_flag == 0 and right_used_flag == 1:
        leftmost = index
        rightmost = left_right_used[index + 1][1]
    else:
        leftmost = rightmost = index
    num_old = max(0, left_right_used[leftmost][1] - left_right_used[leftmost][0] - K + 2) * left_used_flag\
              + max(0, left_right_used[rightmost][1] - left_right_used[rightmost][0] - K + 2) * right_used_flag
    left_right_used[leftmost][1] = rightmost
    left_right_used[rightmost][0] = leftmost
    num_new = max(0, left_right_used[leftmost][1] - left_right_used[leftmost][0] - K + 2)
    num_add = num_new - num_old
    for j in range(num_add):
        range_min, min_index = query(leftmost, rightmost)
        update(min_index, 10 ** 10)
        heapq.heappush(pq, range_min * (-1))

    for j in range(num_add):
        if len(pq) > Q:
            heapq.heappop(pq)
    if len(pq) == Q:
        maximum = heapq.heappop(pq) * (-1)
        ans_new = maximum - A[index]
        ans = min(ans, ans_new)
        heapq.heappush(pq, maximum * (-1))

print(ans)
