#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstdlib>
#include<queue>
#define re register 
#define rep(i,s,t) for(re int i=s;i<=t;++i)
using namespace std;
const int N=1e6+11;
int n,k,q,cnt,ans;
int a[N],b[N],c[N],bl[N],sz[N],id[N];
inline bool cmp(int x,int y){
	return a[x]<a[y];
}
inline void build(){
	cnt=1;
	rep(i,1,n)
		sz[i]=0;
	rep(i,1,n)
		if(c[i])
			++cnt;
		else{
			bl[i]=cnt;
			++sz[cnt];
		}
}
int main(){
	scanf("%d%d%d",&n,&k,&q);
	rep(i,1,n)
		scanf("%d",a+i),id[i]=i;
	ans=1e9+1;
	sort(id+1,id+n+1,cmp);
	rep(i,1,n){
		build();
		int top=i,j;
		for(j=1;j<=q;++j){
			while(top<=n&&sz[bl[id[top]]]<k)
				++top;
			if(top>n)break;
			--sz[bl[id[top]]];
			++top;
		}
		--top;
		//printf("%d %d %d\n",top,a[id[top]],a[id[i]]);
		if(j==q+1&&top<=n){
			
			ans=min(ans,a[id[top]]-a[id[i]]);
		}
		c[id[i]]=1;
	}
	printf("%d\n",ans);
	return 0;
} 