#include <bits/stdc++.h>
using namespace std;
#define Int int64_t
#define dump(x) cout << (x) << endl
#define fi first
#define se second
Int mod = 1e9+7;
Int INF = 1e18;
double EPS = 0.00000001;
//Int mod = 1e6+3;

int main() {
    Int n, k, q;
    cin >> n >> k >> q;
    vector<Int> a(n);
    for (Int i = 0; i < n; i++) cin >> a[i];
    vector<Int> b = a;
    sort(b.begin(), b.end());
    vector<pair<Int, Int>> c(n);
    for (Int i = 0; i < n; i++) c[i] = {a[i], i};
    sort(c.begin(), c.end());
    Int mi = b[q - 1] - b[0];
    vector<bool> use(n, true);
    for (Int i = 0; i <= n - q; i++) {
        use[c[i].se] = false;
        vector<Int> v;
        Int j = 0;
        while (j < n - i - 1) {
            vector<Int> vx;
            while (use[j] && j < n - i - 1) {
                vx.emplace_back(a[j]);
                j++;
            }
            if ((Int)vx.size() >= k) {
                sort(vx.begin(), vx.end());
                for (Int l = 0; l <= (Int)vx.size() - k; l++) {
                    v.emplace_back(vx[l]);
                }
            }
            j++;
        }
        if ((Int)v.size() < q) {
            break;
        }
        else {
            sort(v.begin(), v.end());
            mi = min(mi, v[q - 1] - v[0]);
        }
    }
    dump(mi);
    return 0;
}