#include<bits/stdc++.h>
using namespace std;
int n,k,Q,ans=1e9,a[2005];
priority_queue<int> q;
vector<int> q2;
void update(){
	while(!q.empty()){
		if(q.size()>=k)q2.push_back(-q.top());
		q.pop();
	}
}
int main(){
	scanf("%d%d%d",&n,&k,&Q);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			if(a[j]>=a[i])q.push(-a[j]);
			else update();
		}
		update();
		if(q2.size()>=1)sort(q2.begin(),q2.end());
		if(q2.size()>=Q&&q2[0]==a[i])ans=min(ans,q2[Q-1]-a[i]);
		q2.clear();
	}
	printf("%d",ans);
	return 0;
}