#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = 1000000007LL;
int A[2000];
int main() {
	ll N, K, Q;
	cin >> N >> K >> Q;
	for (int i = 0; i < N; i++) cin >> A[i];
	int ans = 1 << 30;
	for (int i = 0; i < N; i++) {
		vector<vector<int>> vec;
		vector<int> v;
		vector<int> m;
		for (int j = 0; j < N; j++) {
			if (A[i] <= A[j]) {
				v.push_back(A[j]);
			}
			else {
				if (!v.empty()) vec.push_back(v);
				v.clear();
			}
		}
		if (!v.empty()) vec.push_back(v);
		for (int j = 0; j < vec.size(); j++) {
			if (vec[j].size() < K) continue;
			sort(vec[j].begin(), vec[j].end());
			for (int k = 0; k + K <= vec[j].size(); k++) m.push_back(vec[j][k]);
		}
		sort(m.begin(), m.end());
		if (m.size() >= Q) ans = min(ans, m[Q - 1] - A[i]);
	}
	cout << ans << endl;
}