#include <bits/stdc++.h>
using namespace std;
int n,K,Q,a[2005],w[2005],s[2005],temp[2005];
int main(){
	scanf("%d%d%d",&n,&K,&Q);
	for(int i=1;i<=n;i++) scanf("%d",&a[i]),w[i]=a[i];
	sort(w+1,w+n+1);
	int ans=2e9;
	for(int i=1;i<=n;i++){
		int top=0;
		for(int p=1,j;p<=n;){
			if(a[p]<w[i]){
				p++;continue;
			}
			for(j=p;a[j]>=w[i]&&j<=n;j++) temp[j-p+1]=a[j];
			sort(temp+1,temp+j-p+1);
			for(int k=1;k<=j-p-K+1;k++) s[++top]=temp[k];
			p=j;
		}
		sort(s+1,s+top+1);
		if(top>=Q) ans=min(ans,s[Q]-s[1]);
	}
	printf("%d",ans);
	return 0;
}