#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<algorithm>
#include<math.h>
using namespace std;
int n,k,q,a[20005],b[20005],c[20005],tmp[20005],tot,ans;
void clr(int l,int r)
{
	int i;
	int len=(r-l+1);
	for(i=l;i<=r;++i) tmp[i]=a[i];
	sort(tmp+l,tmp+r+1);
	while(len>=k)
	{
		c[++tot]=tmp[l];
		++l,--len;
	}
}
void work(int x)
{
	tot=0;
	int i;
	for(i=1;i<=2000;++i) c[i]=2e9+7;
	int l=1,r=1;
	while(l<=n)
	{
		while(a[r]>=x&&r<=n) ++r;
		--r;
		if(r<l)
		{
			++l,r=l;
			continue;
		}
		clr(l,r);
		l=r+1;
		++r;
	}
	sort(c+1,c+tot+1);
	ans=min(ans,c[q]-x);
}
int main()
{
	int i;
	ans=1e9+7;
	scanf("%d%d%d",&n,&k,&q);
	for(i=1;i<=n;++i)
	{
		scanf("%d",&a[i]);
		b[i]=a[i];
	}
	sort(b+1,b+n+1);
	for(i=1;i<=n;++i) work(b[i]);
	printf("%d",ans);
	return 0;
}