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[:K] = 1
    elif j >= N - K:
        luck_flag[-K:] = 1
    else:
        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 = lii()
    A = lii()
    Asort = sorted(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):
        luck_ix.append(ix[i])
        bisect.insort(luck_ix, ix[i])
        luck_flag = manage_luck_flag(luck_flag, ix[i], K)

        cnt = n_removable(N, luck_ix, K)
        # print(i, cnt)
        j = i+Q

        # print(luck_flag)
        while luck_flag[ix[j]] == 1 and j < N:
            j += 1
            if j == N:
                return diff

        if Q > cnt:
            return diff

        # print(i, cnt)
        diff = min(diff, Asort[j] - Asort[i+1])

    return diff

if __name__ == '__main__':
    print(main())