#include<bits/stdc++.h>
using namespace std;
const int Maxn=2001;
int a[Maxn],n,f,q;

void init(){
	cin>>n>>f>>q;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
}

int main(){
	init();
	int x,y,ans=2147483647;
	
	for(int i=1;i<=n;i++){
		x=a[i];
		int l[n+1],r[n+1];
		memset(l,0,sizeof(l));
		memset(r,0,sizeof(r));
		l[1]=1; int c=1;
		for(int j=1;j<=n;j++){
			if(a[j]<x){
				if(a[j-1]>=x)r[c]=j-1;
				
				if(j!=n&&a[j+1]>=x)l[++c]=j+1;
			}
		}
		if(a[n]>=x)r[c]=n;
		
		/*for(int j=1;j<=c;j++){
			cout<<l[j]<<' '<<r[j]<<endl;
		}*/
		
		int e[n+1],tot=0;
		memset(e,0,sizeof(e));
		for(int j=1;j<=c;j++){
			int w[n+1],size=r[j]-l[j]+1;
			for(int k=l[j];k<=r[j];k++)
				w[k-l[j]]=a[k];
			
			sort(w,w+size);
			for(int k=0;k<=size-f;k++){
				e[++tot]=w[k];
			}
		}
		sort(e+1,e+tot+1);
		
		y=e[q];
		//cout<<x<<' '<<y<<endl;
		if(e[q]==0)continue ;
		ans=min(ans,y-x);
	}
	cout<<ans;
}