/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author yassin
 */

#include <bits/stdc++.h>

using namespace std;

class arc098e {
public:
    void solve(istream& in, ostream& out) {
        int N, K, Q;
        in >> N >> K >> Q;
        vector<int> A(N);
        for (int i = 0; i < N; ++i) {
            in >> A[i];
        }
        vector<int> B(A);
        sort(begin(B), end(B));
        int res = 2'000'000'000;
        for (int i = 0; i + Q <= N; ++i) {
            int low = i + Q - 1, high = N - 1, ans = N;
            while (low <= high) {
                int mid = (low + high) / 2;
                if (B[mid] - B[i] > res) {
                    high = mid - 1;
                    continue;
                }
                int cnt = 0;
                multiset<int> cur;
                for (int j = 0, k = 0; j < N; ) {
                    while (k < N && (int)cur.size() < K) {
                        cur.insert(A[k]);
                        ++k;
                    }
                    if ((int)cur.size() < K) {
                        break;
                    }
                    int mn = *cur.begin();
                    if (mn >= B[i] && mn <= B[mid]) {
                        ++cnt;
                        cur.erase(cur.begin());
                    } else {
                        if (cur.count(A[j])) {
                            cur.erase(cur.find(A[j]));
                        }
                        ++j;
                    }
                }
                if (cnt >= Q) {
                    high = mid - 1;
                    ans = mid;
                } else {
                    low = mid + 1;
                }
            }
            if (ans < N) {
                //cout << B[i] << " " << B[ans] << endl;
                res = min(res, B[ans] - B[i]);
            }
        }
        out << res << "\n";
    }
};

int main() {
	std::ios::sync_with_stdio(false); cin.tie(nullptr);
	arc098e solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}
