import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;

enum inf = 1L<<60;

void main() {
    int n, k, q;
    scan(n, k, q);
    auto a = readln.split.to!(long[]);

    auto as = a.enumerate.array.sort!"a.value < b.value"().array;

    debug {
        writeln(as);
    }

    auto bit = FenwickTree!(int)(n + 1);

    long ans = as[q-1].value - as[0].value;
    long am = as.front.value;

    foreach (i ; 0 .. n) {
        while (!as.empty && as.front.value <= am) {
            bit.add(max(0, as.front.index.to!int - k + 1), 1);
            bit.add(min(n, as.front.index.to!int + k), -1);
            as.popFront();
        }

        long mx = inf;
        int cnt;
        long[] bb;

        foreach (j ; 0 .. n) {
            if (a[j] == am || bit.sum(j+1) > 0) {
                continue;
            }
            bb ~= a[j];
        }

        bb.sort();

        debug {
            writeln(bb);
        }

        if (bb.length.to!int < q) {
            break;
        }

        ans = min(ans, bb[q-1] - am);
        am = as.front.value;
    }

    writeln(ans);
}





struct FenwickTree(T) {
    private {
        int _size;
        T[] _data;
    }

    this(int N) {
        _size = N;
        _data = new T[](_size + 1);
    }

    void add(int i, T x) {
        i++;
        while (i <= _size) {
            _data[i] += x;
            i += i & (-i);
        }
    }

    T sum(int r) {
        T res = 0;
        while (r > 0) {
            res += _data[r];
            r -= r & (-r);
        }
        return res;
    }
}








































void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}
