#include<bits/stdc++.h>
using namespace std;

int n,k,q;
int a[2005];
int p;
int t[2005];
int b[2005];
int c[2005];
int pp,ppp;
int s;
int ans;
int sum;
int r;

int main(){
	cin>>n>>k>>q;
	ans=0x3f3f3f3f;
	for(int i=1;i<=n;i++)cin>>a[i];
	
	for(int i=1;i<=n;i++){
		p=0,s=0,sum=0;
		pp=0;ppp=0;
		for(int j=1;j<=n;j++)if(a[j]>=a[i])t[++p]=j;
		if(p<q)continue;
//		for(int j=1;j<=p;j++)cout<<t[j]<<" ";
//		cout<<endl;
		for(int j=1;j<=p+1;j++){
			if(t[j]==t[j-1]+1){
				s++;
			}
			else{
				pp=0;
				if(s>=k){
					for(int l=j-s;l<j;l++)b[++pp]=a[t[l]];
					sort(b+1,b+pp+1);
					for(int l=1;l<=s-k+1;l++)c[++ppp]=b[l];
				}
				s=1;
			}
		}
//		cout<<ppp<<endl;
//		for(int j=1;j<=ppp;j++)cout<<c[j]<<" ";
//		cout<<endl;
		sort(c+1,c+ppp+1);
		if(ppp>=q)ans=min(ans,c[q]-a[i]);
	}
	cout<<ans;
}

		