#include <bits/stdc++.h>
#define X first
#define Y second
#define pb push_back
#define sz(a) (int)a.size()
#define int long long

using namespace std;

int a[2010];

vector <pair <int, int>> v;

int kok[2010];
int pref[2010];

vector <int> sok;

int ans = 1e10;

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n, k, q;
    cin >> n >> k >> q;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        v.pb({a[i], i});
    }
    sort(v.begin(), v.end());
    for (int i = 0; i <= n - q; i++) {
        sok.clear();
        for (int j = 0; j < i; j++)
            sok.pb(v[j].second);
        sort(sok.begin(), sok.end());
        for (int j = 0; j <= n; j++) {
            kok[j] = 0;
            pref[j] = 0;
        }
        for (int j = i; j < i + q; j++) {
            kok[v[j].second] = 1;
        }
        for (int j = 1; j <= n; j++) {
            pref[j] = pref[j - 1] + kok[j - 1];
        }
        int nch = 0;
        bool f = true;
        for (int j = 0; j < sz(sok); j++) {
            if (pref[sok[j]] - pref[nch] > 0 && sok[j] - nch - pref[sok[j]] + pref[nch] < k - 1) {
                f = false;
                break;
            }
            nch = sok[j] + 1;
        }
        if (pref[n] - pref[nch] > 0 && n - nch - pref[n] + pref[nch] < k - 1) {
            f = false;
        }
        if (f) {
            ans = min(ans, v[i + q - 1].first - v[i].first);
    }
    cout << ans << endl;
    return 0;
}

