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

const int MAXN = 2005;

int n, k, q;

int a[MAXN];
int dx[MAXN], top = 0;

void work(int L, int R)
{
	if (L > R) return;
	static int stk[MAXN];
	int stk_top = 0, len = R-L+1;
	for (int i = L; i <= R; i++) stk[++stk_top] = a[i];
	sort(stk+1, stk+stk_top+1);
	for (int i = 1; i <= len-k+1; i++)
		dx[++top] = stk[i];
}

int main()
{
	scanf("%d%d%d", &n, &k, &q);
	for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
	int ans = 1e9;
	for (int i = 1; i <= n; i++) {
		int last = 0;
		top = 0;
		for (int j = 1; j <= n; j++) {
			if (a[j] < a[i]) {
				work(last+1, j-1);
				last = j;
			}
		}
		work(last+1, n);
		sort(dx+1, dx+top+1);
		if (top >= q) ans = min(ans, dx[q]-dx[1]);
	}
	cout << ans << endl;
	return 0;
}
