#include <bits/stdc++.h>

using namespace std;

int a[2222];
int main()
{
	int n, k, q;
	cin >> n >> k >> q;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	int m = 2e9;
	for (int i = 0; i < n; i++) {
		vector<int> b;
		for (int s = 0, t; s < n; s = t + 1) {
			for (t = s; t < n&&a[t] >= a[i]; t++);
			if (t - s < k) continue;
			b.insert(b.end(), a + s, a + t);
			sort(b.end() - (t - s), b.end());
			b.erase(b.end() - (k - 1), b.end());
		}
		sort(b.begin(), b.end());
		if (b.size() >= q)
			m = min(m, b[q - 1] - b[0]);
	}
	cout << m << endl;
	return 0;
}
