#include <algorithm>
#include <iostream>
#include <cstdio>

using namespace std;

const int Maxn = 2010;
const int Inf = 0x7fffffff;

int n , k , q , ans = Inf;
int a[Maxn];
int tmp[Maxn] , Q[Maxn];

int main() {
	
	scanf("%d%d%d",&n,&k,&q);
	for(register int i=1; i<=n; i++)
		scanf("%d",&a[i]);
	
	for(register int i=1; i<=n; i++) {
		Q[0] = 0;
		for(register int j=1; j<=n+1; j++) {
			if(a[j] < a[i]) {
				sort(tmp+1,tmp+tmp[0]+1);
				for(register int x=1; x<=tmp[0]-k+1; x++)
					Q[++Q[0]] = tmp[x];
				tmp[0] = 0;
			}
			else	tmp[++tmp[0]] = a[j];
		}
		sort(tmp+1,tmp+tmp[0]+1);
		for(register int x=1; x<=tmp[0]-k+1; x++)
			Q[++Q[0]] = tmp[x];
		tmp[0] = 0;
		if(Q[0] < q)	continue;
		sort(Q+1,Q+Q[0]+1);
		ans = min(ans,Q[q]-a[i]);
	}
	
	printf("%d\n",ans);
	
	return 0;
	
}