#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int n,k,q;
int main()
{
	cin>>n>>k>>q;
	vector<int>a(n);
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	int ans=1e9;
	vector<int>b;
	b.push_back(n);
	while(1)
	{
		int f=0;
		int mina=2e9,mini=-1;
		vector<int>now;
		for(int i=0;i<b.size();i++)
		{
			vector<pair<int,int> >tmp;
			for(int j=f;j<b[i];j++)
			{
				tmp.push_back(make_pair(a[j],j));
			}
			sort(tmp.begin(),tmp.end());
			for(int j=0;b[i]-f-j>=k;j++)
			{
				now.push_back(tmp[j].first);
			}
			if(!tmp.empty()&&tmp[0].first<mina)
			{
				mina=tmp[0].first;
				mini=tmp[0].second;
			}
			f=b[i]+1;
		}
		if(now.size()<q)break;
		sort(now.begin(),now.end());
		ans=min(ans,now[q-1]-now[0]);
		b.push_back(mini);
		sort(b.begin(),b.end());
	}
	cout<<ans<<endl;
}