#include<bits/stdc++.h>
using namespace std;
const int N=2005;
const int inf=0x3f3f3f3f;
int l,top,n,k,Q,a[N],b[N],ans,q[N];
vector<int> vec;
int solve(int x)
{
	l=1;vec.clear();
	for (int i=1;i<=n+1;i++)
	  if (a[i]<x)
	  {
	  	  if (i-l>=k)
	  	  {
	  	  	  top=0;
	  	  	  for (int j=l;j<i;j++) q[++top]=a[j];
	  	     sort(q+1,q+top+1);
	  	     for (int j=1;j<=i-l-k+1;j++) vec.push_back(q[j]);
		  }
	  	  l=i+1;
	  }
	sort(vec.begin(),vec.end());
	if (Q-1>=vec.size()) return inf;
	return vec[Q-1]-x;
}
int main()
{
	scanf("%d%d%d",&n,&k,&Q);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]),b[i]=a[i];
	sort(b+1,b+n+1);ans=inf;
	for (int i=1;i<=n;i++) ans=min(ans,solve(b[i]));
	printf("%d\n",ans);
	return 0;
}