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

#define inf 0x7f7f7f7f
const int N=2100;

int n,k,q,x,y,ans=inf;
int a[N];
priority_queue<int,vector<int>,greater<int> >que;
multiset<int>lans;

int main()
{
	scanf("%d%d%d",&n,&k,&q);
	for(int i=1;i<=n;i++)scanf("%d",a+i);
	for(int i=1;i<=n;i++)
	{
		x=a[i];y=inf;
		lans.clear();
		que=priority_queue<int,vector<int>,greater<int> >();
		for(int j=1;j<=n+1;j++)
			if(j>n||a[j]<x)
			{
				while(que.size()>=k)
				{
					lans.insert(que.top());
					que.pop();
				}
				que=priority_queue<int,vector<int>,greater<int> >();
			}
			else que.push(a[j]);
		int cnt=1;
		for(auto it=lans.begin();it!=lans.end();it++,cnt++)
			if(cnt==q){y=*it;break;}
		//printf("%d %d\n",x,y);
		ans=min(y-x,ans);
	}
	printf("%d\n",ans);
	return 0;
}