#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int s[2005];
int n,k,q;
int main()
{
	cin>>n>>k>>q;
	for(int i=1;i<=n;i++){
		cin>>s[i];
	}
	ll ans=1ll<<50;
	for(int i=1;i<=n;i++){
		vector<int> v;
		for(int j=1;j<=n;){
			vector<int> c;
			int z=j;
			while(z<=n && s[z]>=s[i]) z++;
			if(z-j>=k){
				for(int o=j;o<z;o++){
					c.push_back(s[o]);
				}
				sort(c.begin(),c.end());
				for(int o=0;o<z-j-k+1;o++){
					v.push_back(c[o]);
				}
			}
			if(j==z) z++;
			j=z;
		}
		if(v.size()>=q){
			sort(v.begin(),v.end());
			ans=min(ans,0ll+v[q-1]-v[0]);
		}
	}
	cout<<ans;
	return 0;
}
