#include<bits/stdc++.h>
using namespace std;
int read(){int k;scanf("%d",&k);return k;}
const int maxx = 40001;
struct A{int v,id;}a[maxx];
int V[maxx];
int n,k,Q;
int x1,f[maxx];
int q[maxx],ans=1000000000;
int tail=0;
int flag[maxx];
int aa[maxx];
int top=0;
void slove(){
	tail=0;top=0;
	for(int i=1;i<=n;i++){
		if(V[i]<x1)f[i]=1;
		if(f[i]==0){aa[++top]=V[i];}
		if(f[i]==1||i==n){if(top<k){top=0;continue;}
			sort(aa+1,aa+top+1);
			for(int i=1;i<=top-k+1;i++){
				q[++tail]=aa[i];
			}top=0;
		}
	}
	if(tail<Q)return ;
	sort(q+1,q+tail+1);
	ans=min(ans,q[Q]-x1);
	return ;
}
int main(){
	n=read();k=read();Q=read();
	for(int i=1;i<=n;i++)V[i]=read();
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++)f[j]=0;
		x1=V[i];
		slove();
	}
	cout<<ans<<endl;
	return 0;
}