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

def make_min_array(A):
    A_min = []
    for i in range(len(A) - k + 1):
        tmp = A[i]
        for j in range(i, len(A)):
            tmp = min(tmp, A[j])
            A_min.append(tmp)
    return A_min

A_out = []
for i in range(q):
    tmp = min(make_min_array(A_input))
    A_out.append(tmp)
    A_input.remove(tmp)



print(max(A_out)-min(A_out))