#include<bits/stdc++.h>
#define INF 0x7fffffff
using namespace std;
int n,k,q,a[2005],b[2005],ans=INF,c[2005],d[2005],t;
inline int read(){
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();}
    return x*f;
}
int check(int x){
	for(int i=1;i<=n;++i) c[i]=a[i];
	int l=0; t=0;
	for(int r=1;r<=n;++r){
		if(c[r]>=x) continue;
		if(r-l-k>0){
			sort(c+l+1,c+r);
			for(int i=l+1;i<=r-k;++i) d[++t]=c[i];
		}
		l=r;
	}
	sort(c+l+1,c+n+1);
	if(n-l-k+1>0) for(int i=l+1;i<=n-k+1;++i) d[++t]=c[i];
	if(t>=q){
		sort(d+1,d+t+1);
		return d[q]-x;
	}
	else return INF;
}
int main(){
	n=read(),k=read(),q=read();
	for(int i=1;i<=n;++i) b[i]=a[i]=read();
	sort(b+1,b+n+1);
	for(int i=1;i<=n;++i) ans=min(check(b[i]),ans);
	printf("%d",ans);
}