#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

int n,k,q;
int a[5000],b[5000];

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>tr;

signed main(){
	scanf("%d%d%d",&n,&k,&q);
	set<P>mp;
	rep(i,n)scanf("%d",&a[i]),b[i]=a[i],mp.insert({a[i],i});
	sort(b,b+n);
	int ans=b[q-1]-b[0];
	set<int>se;
	se.insert(-1);
	se.insert(n);
	rep(i,n){
		int d=mp.begin()->first;
		se.insert(mp.begin()->second);
		mp.erase(mp.begin());
		int cnt=0;
		int Min=-1,Max=-1;
		tr.clear();
		rep(j,n){
			if(b[j]>d)tr.insert(j);
		}
		for(auto IT=mp.begin();IT!=mp.end();IT++){
			if(IT->first<=d)continue;
			if(cnt==q)break;
			auto it=se.lower_bound(IT->second);
			auto it2=it;it2--;
			//if(*it-*it2-1<k)continue;
			int a=tr.order_of_key(*it);
			int b=tr.order_of_key(*it2);
			if(a-b<k)continue;
			if(cnt==0){
				Min=Max=IT->first;
			}
			Min=min(Min,IT->first);
			Max=max(Max,IT->first);
			tr.erase(IT->second);
			cnt++;
		}
		if(cnt==q)ans=min(ans,Max-Min);
	}
	cout<<ans<<endl;
}