#include <bits/stdc++.h>
using namespace std;

int n, m, k, q, a[2004], b[2004];

int main() {
	cin >> n >> k >> q;
	for (int i=0; i<n; i++) cin >> a[i], b[i] = a[i];

	sort(b, b+n);
	m = unique(b, b+n) - b;

	int ans = 2e9;
    for (int i=0; i<m; i++) {
		vector<int> v, u;
		for (int j=0; j<=n; j++) {
			if (a[j] < b[i]) {
				sort(v.begin(), v.end());
				for (int t=0; t<(int)v.size()-k+1; t++) u.push_back(v[t]);
				v.clear();
			} else v.push_back(a[j]);
		}
		sort(u.begin(), u.end());
		if (u.size() >= q) ans = min(ans, u[q-1] - b[i]);
    }
    cout << ans;
}
