//raja1999
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip> 
//setbase - cout << setbase (16)a; cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 <<endl;prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val

using namespace std;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >

//std::ios::sync_with_stdio(false);
ll a[2005];
multiset<ll>se1;
multiset<ll>::iterator it;
pii a1[2005];
vector<set<ll> >se(2005);
set<ll>::iterator it1;
int main(){
	std::ios::sync_with_stdio(false);
	ll n,k,q,ans=inf,i,val,val1,r,j,minn=inf;
	cin>>n>>k>>q;
	rep(i,n){
		cin>>a[i];
		a1[i].ff=a[i];
		a1[i].ss=i;
	} 
	rep(i,n){
		val=i-k+1;
		val=max(val,0);
		minn=inf;
		se1.clear();
		f(j,val,val+k){
			minn=min(minn,a[j]);
			se1.insert(a[j]);
		}
		r=val+k-1;
		se[i].insert(minn);
		f(j,val+1,i+1){
			if(r+1>=n){
				break;
			}
			it=se1.find(a[j-1]);
			se1.erase( it);
			se1.insert(a[r+1]);
			val1=*se1.begin();
			se[i].insert(val1);
			r++;
		}
	}
	sort(a1,a1+n);
	rep(i,n-k+1){
		if(i+q-1<n-k+1){
			if(i>0){
				val=a[i-1];
			}
			else{
				val=0;
			}
			f(j,i,i+q){
				it1=se[a1[j].ss].upper_bound(val);
				if(it1==se[j].end()){
					break;
				}
			}
			if(j==i+q){
				ans=min(ans,a1[i+q-1].ff-a1[i].ff);
			}
		}
	}	
	cout<<ans<<endl;
} 
	