#include<queue> 
#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
priority_queue <int> q;
int a[101010],c[2020];
int main()
{
	int ans,cnt,i,k,p,mx,mn,tmp,n,j,sum=0;
	ans=1000000007;
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	scanf("%d%d%d",&n,&k,&p);
	for(i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=1;i<=n;i++)
	{
		cnt=0;
		sum=0;
		for(j=1;j<=n;j++)
		{
			if(a[j]>=a[i])
			{
				q.push(-a[j]);
				sum++;
				if(sum>=k)
				{
					tmp=q.top();
					tmp=-tmp;
					c[++cnt]=tmp;
					q.pop();
				}
			}
			else
			{
				while(!q.empty())
					q.pop(); 
				sum=0;	
			}
		}
		if(cnt>=p)
		{
			sort(c+1,c+cnt+1);
			ans=min(ans,c[p]-a[i]);
		}
//		printf("%d %d\n",i,ans);
		while(!q.empty())
			q.pop();
		memset(c,0,sizeof(c));
	}
	printf("%d\n",ans);
	return 0;
}
