def main():
    N, K, Q = map(int, input().split())
    A = list(map(int, input().split()))
    ans = float("inf")
    for X in A:
        targets = []
        target = []
        for a in A:
            if a >= X:
                target.append(a)
            elif a < X:
                if len(target) >= K:
                    target.sort()
                    targets += target[:len(target)-(K-1)]
                target = []
        target.sort()
        targets += target[:len(target)-(K-1)]
        targets.sort()
        if len(targets) >= Q:
            ans = min(targets[Q-1] - targets[0], ans)
    print(ans)


if __name__ == "__main__":
    main()
