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

int main(int argc, char const *argv[])
{
	int n,k,q;
	cin>>n>>k>>q;
	int a[n];
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
	}
	int ans=1000000000;
	for (int i = 0; i < n; ++i)
	{
		vector<int> tmp1,tmp2;
		for (int j = 0; j < n; ++j)
		{
			if (a[i]>a[j])
			{
				if (tmp1.size()>=k)
				{
					sort(tmp1.begin(), tmp1.end());
					int cnt=(int)tmp1.size()-k+1;
					for (int l = 0; l < cnt; ++l)
					{
						tmp2.push_back(tmp1.at(l));
					}
				}
				tmp1={};
			}
			else
			{
				tmp1.push_back(a[j]);
			}
		}
		if (tmp1.size()>=k)
		{
			sort(tmp1.begin(), tmp1.end());
			int cnt=(int)tmp1.size()-k+1;
			for (int l = 0; l < cnt; ++l)
			{
				tmp2.push_back(tmp1.at(l));
			}
		}
		if (tmp2.size()>=q)
		{
			sort(tmp2.begin(), tmp2.end());
			ans=min(ans,tmp2.at(q-1)-tmp2.at(0));
		}
	}
	cout<<ans<<endl;
	return 0;
}
