#include <bits/stdc++.h>
using namespace std;
						
#define fast_cin() ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define endl '\n'
#define int long long
				
int32_t main() {
	fast_cin();  
	int n; cin >> n;
	int k, q; cin >> k >> q;
	vector<int> a(n);
	for (int &i : a) {
		cin >> i;
	}
	int ans = 1e9 + 7;
	for (int bound : a) {
		vector<int> final;
		for (int i = 0, j = 0; i < n; i = j) {
			if (a[i] < bound) {
				++j;
				continue;
			}
			vector<int> temp;
			while (j < n && a[j] >= bound) {
				temp.push_back(a[j]);
				++j;
			}
			if (temp.size() >= k) {
				sort(temp.begin(), temp.end());
				for (int l = 0; l < (int)temp.size() - k + 1; ++l) {
					final.push_back(temp[l]);
				}
			}
		}
		sort(final.begin(), final.end());
		if ((int)final.size() < q) continue;
		ans = min(ans, final[q - 1] - final[0]);
	}
	cout << ans << endl;
	return 0;
}