#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //ai>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //ai>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define REV(x) (reverse(x.begin(),x.end())) //reverse
#define TO(x,t,f) ((x)?(t):(f))
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define FILV(x,a) fill(x.begin(),x.end(),a)
#define FILA(ar,N,a) fill(ar,ar+N,a)
#define NEXTP(x) next_permutation(x.begin(),x.end())
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)return b;else return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}//saisyo kobaisu
#define pb push_back
#define pri(aa) cout<<(aa)<<endl
const ll INF=1e9+7;
const ll N = 300002;




ll n,k,q,ans=INF;
vector<ll> a;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>n>>k>>q;
	FOR(i,0,n){
		ll ooo;cin>>ooo;
		a.pb(ooo);
	}


	FOR(i,0,n){
		ll minl=a[i],maxl;
		vector<ll> w;
		vector<ll> toru;
		FOR(j,0,n){
			if(a[j]<minl){
				SORT(w);
				FOR(dd,0,min(q,w.size()-k+1)){
					toru.pb(w[dd]);
				}
				w.clear();
			}else{
				w.pb(a[j]);
			}
		}
		SORT(w);
		FOR(dd,0,min(q,w.size()-k+1)){
			toru.pb(w[dd]);
		}
		SORT(toru);
		if(toru.size()<q)continue;
		maxl=toru[q-1];
		ans=min(ans,maxl-minl);
	}
	pri(ans);
	return 0;
}
