#include<bits/stdc++.h>
#define to edge[i].v
#define mp make_pair
#define rint register int
#define debug(x) cerr<<#x<<"="<<x<<endl
#define fgx cerr<<"-------------"<<endl
#define N 1000000
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
int a[N]; vector<int> v,b;
int main()
{	int n,k,q,ans=1e9; cin>>n>>k>>q;
	for(rint i=1;i<=n;i++) scanf("%d",&a[i]);
	for(rint i=1;i<=n;i++)
	{	b.clear(); int p=1;
		while(p<=n)
		{	if(a[p]<a[i]){p++;continue;}
			v.clear();
			while(a[p]>=a[i]&&p<=n) v.pb(a[p]),p++;
			if(v.size()<k) continue;
			sort(v.begin(),v.end());
			for(rint j=0;j<=(int)v.size()-k;j++) b.pb(v[j]); 
		}
	//	debug(a[i]);debug(b.size());if(a[i]==1) debug(b[0]),debug(b[1]),debug(b[2]);
		if(b.size()<q) continue;
		sort(b.begin(),b.end()); ans=min(ans,b[q-1]-b[0]);
	}
	cout<<ans;
	return 0;
}
