N, K, Q = map(int, input().split())
A = list(map(int, input().split()))
ans = float('inf')
for a in A: # YがA
    X = []
    Now = []
    for b in A:
        if b >= a:
            Now.append(b)
        else:
            if len(Now) < K:
                Now = []
            else:
                Now.sort()
                X += Now[:len(Now) -K + 1]
    if len(Now) >= K:
        Now.sort()
        X += Now[:len(Now) - K + 1]
    if len(X) < Q:
        continue
    else:
        x = X[Q-1]
        ans = min(ans, x - a)
print(ans)

