#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define rep(i, a, b) for(int i = a; i < b; ++i)

main() {
    int n, k, q;
    cin >> n >> k >> q;
    vector <int> a(n, 0);
    rep(i, 0, n) {
        cin >> a[i];
    }
    int ans = 2e9;
    rep(i, 0, n) {
        vector <int> b;
        vector <int> cur;
        rep(j, 0, n + 1) {
            if (j == n || a[j] < a[i]) {
                {
                    int len = cur.size();
                    sort(cur.begin(), cur.end());
                    rep(jj, 0, len - k + 1) {
                        b.push_back(cur[jj]);
                    }
                    cur.clear();
                }
            } else {
                cur.push_back(a[j]);
            }
        }
        int len = b.size();
        if (len >= q) {
            ans = min(ans, b[q - 1] - a[i]);
        }
    }
    cout << ans << '\n';
}