#include <iostream>
#include <vector>
#include <algorithm>
#include <limits>

using namespace std;

int main(int argc, char *argv[]) {
	int N, K, Q;
	cin >> N >> K >> Q;
	vector<int> A(N);
	for (int i = 0; i < N; i++) cin >> A[i];

	int ans = numeric_limits<int>::max();
	for (int i = 0; i < N; i++) {
		vector<vector<int>> seq(1);
		for (int j = 0; j < N; j++) {
			if (A[j] >= A[i]) {
				seq.back().push_back(A[j]);
			} else {
				if (!seq.back().empty())
					seq.push_back(vector<int>());
			}
		}

		vector<int> candid;
		for (auto &s : seq) {
			if (s.size() < K) continue;
			sort(begin(s), end(s)); 
			candid.insert(end(candid), begin(s), end(s) - (K - 1));
		}

		sort(begin(candid), end(candid));
		if (candid.size() >= Q)
			ans = min(ans, candid[Q - 1] - A[i]);
	}

	cout << ans << endl;

	return 0;
}
