#include<bits/stdc++.h>
using namespace std;

int arr[2009];

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int n,k,q;
	cin>>n>>k>>q;

	vector<int> v;
	for(int i=0;i<n;i++){
		cin>>arr[i];
		v.push_back(arr[i]);
	}

	sort(v.begin(),v.end());
	int ans = INT_MAX;

	for(int i=0;i<n;i++){
		vector<int> val;
		vector<int> res;
		for(int j=0;j<n;j++){
			if(arr[j]>=v[i]){val.push_back(arr[j]);}
			else{
				sort(val.begin(),val.end());
				int len = (int)val.size();
				for(int a=0;a<len-k+1;a++){res.push_back(val[a]);}
				val.clear();
			}
		}
		sort(val.begin(),val.end());
		int len = (int)val.size();
		for(int a=0;a<len-k+1;a++){res.push_back(val[a]);}
		if((int)res.size() >= q){
			sort(res.begin(),res.end());
			ans = min(ans,(res[q-1]-v[i]));
		}
	}
	cout<<ans<<endl;
}