#include <bits/stdc++.h>
using namespace std;
const int maxn = 2010;
int n, k, q, a[maxn], ans = 2e9;
int b[maxn], bcnt, c[maxn], ccnt;

void calc() {
	sort(b + 1, b + bcnt + 1);
	for (int i = 1; i <= bcnt - k + 1; ++i) c[++ccnt] = b[i];
}

void solve(int v) {
	bcnt = ccnt = 0;
	for (int i = 1; i <= n; ++i)
		if (a[i] >= v) b[++bcnt] = a[i];
		else if (bcnt) {
			calc(); bcnt = 0;
		}
	if (bcnt) calc();
	sort(c + 1, c + ccnt + 1);
	if (q <= ccnt) ans = min(ans, c[q] - v);
}

int main() {
	scanf("%d%d%d", &n, &k, &q);
	for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
	for (int i = 1; i <= n; ++i)
		solve(a[i]);
	printf("%d", ans);
}
