#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
inline int read(){
	int x=0,f=1;char ch;
	do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');
	do{x=x*10+ch-'0';ch=getchar();}while(ch>='0'&&ch<='9');
	return x*f;
}
const int N=2010,INF=0x3f3f3f3f;
int a[N],b[N],tmp[N],lt,c[N],lc;
bool is[N];
int main(){
	int n=read(),k=read(),q=read(),ans=INF;
	for (int i=1;i<=n;++i) a[i]=b[i]=read();
	sort(b+1,b+n+1);
	is[n+1]=1;
	for (int i=1;i<=n;++i){
		for (int j=1;j<=n;++j) if (a[j]<b[i]) is[j]=1;
		lt=lc=0;
		for (int j=1;j<=n+1;++j){
			if (is[j]){
				if (lt>=k){
					sort(tmp+1,tmp+lt+1);
					for (int x=1;x<=lt-k+1;++x) c[++lc]=tmp[x];
				}
				lt=0;
			}
			else tmp[++lt]=a[j];
		}
		if (lc>=q){
			sort(c+1,c+lc+1);
			ans=min(ans,c[q]-b[i]);
		}
	}
	printf("%d\n",ans);
	return 0;
}