N, K, Q = map(int, input().split())
X = list(map(int, input().split()))
Y = sorted(X)

#X = [(i, x) for i, x in enumerate(X)]
#
#Y = sorted(X, key=lambda x: x[1])

r = Y[Q-1] - Y[0]
for y in Y[1:]:
    tmp = []
    tmp2 = []
    for x in X:
        if x < y:
            tmp.sort()
            tn = len(tmp)
            tmp2 += tmp[:tn-K+1]
            tmp = []
            continue
        tmp.append(x)
    tmp2.sort()
    if len(tmp2) >= Q:
        r = min(r, tmp2[Q-1] - y)
print(r)
