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

int n, k, q;
int a[2010];
#define rep(i,n) for(int i=0;i<(n);i++)

int main(int argc, char const *argv[])
{
	cin >> n >> k >> q;
	rep(i, n) cin >> a[i];

	int ans = 1e9;

	rep(l, n) {
		// printf("l %d\n", l);
		vector<int> v[2010];
		int idx = 0;
		rep(i, n) {
			if (a[i] < a[l]) {
				idx++;
				continue;
			}
			v[idx].push_back(a[i]);
		}

		rep(i, 2010) sort(v[i].begin(), v[i].end());
		vector<int> u;

		rep(i, 2010) {
			// printf("i %d\n", i);
			if ((int)v[i].size() < k) continue;
			// printf("size %d\n", (int)v[i].size());
			rep(j, v[i].size() - k + 1) {
				u.push_back(v[i][j]);
			}
		}
		sort(u.begin(), u.end());

		if (u.size() < q) continue;
		ans = min(ans, u[q - 1] - u[0]);
	}

	printf("%d\n", ans);
	return 0;
}