import numpy as np
import bisect


def ii():
    return int(input())


def lii():
    return list(map(int, input().split(' ')))


def lvi(N):
    l = []
    for _ in range(N):
        l.append(ii())
    return l


def lv(N):
    l = []
    for _ in range(N):
        l.append(input())
    return l


def n_removable(N, ix, K):
    # ix is sorted
    cnt = max(0, ix[0] - K + 1)
    for j in range(len(ix) - 1):
        cnt += max(0, ix[j+1] - ix[j] - K)
    cnt += max(0, N - ix[-1] - K)
    return cnt


def manage_luck_flag(luck_flag, j, K):
    luck_flag[j] = 1
    N = len(luck_flag)
    if j < K:
        luck_flag[:j+1] = 1
    if j >= N - K:
        luck_flag[-j-1:] = 1
    if K <= j < N - K:
        for k in range(1, K+1):
            if luck_flag[j - k] == 1:
                for p in range(k+1):
                    luck_flag[j - p] = 1
                break
        for k in range(1, K+1):
            if luck_flag[j + k] == 1:
                for p in range(k+1):
                    luck_flag[j + p] = 1
                break  
    
    return luck_flag


def main(N, K, Q, A):
    A = np.array(A)
    Asort = np.sort(A)
    ix = np.argsort(A)
    luck_ix = []

    diff = Asort[Q-1] - Asort[0]

    luck_flag = np.zeros(N)

    for i in range(N-Q-1):
        bisect.insort(luck_ix, ix[i])
        luck_flag = manage_luck_flag(luck_flag, ix[i], K)

        cnt = n_removable(N, luck_ix, K)
        if Q > cnt:
            return diff

        Asortd = np.sort(A[(1 - luck_flag).astype(bool)])
        # print(luck_flag, Asortd)
        if len(Asortd) < Q:
            return diff

        diff = min(diff, Asortd[Q-1] - Asortd[0])

    return diff

if __name__ == '__main__':
    N, K, Q = lii()
    A = lii()
    print(main(N, K, Q, A))
    exit()

    # for _ in range(100):
    #     N = 2000
    #     K = np.random.randint(N) + 1
    #     Q = np.random.randint(N - K + 1) + 1
    #     A = np.random.randint(20, size=N)
    #     # print(N, K, Q, A)
    #     print(main(N, K, Q, A))