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

template <typename T> void chmin(T &x,const T &y)
{
	if(x>y)x=y;
}
#define rep(i,l,r) for(int i=l;i<=r;++i)
const int N=2000+5;
int n,k,m,ans;
int a[N],b[N];
bool mark[N];
bool a_xiao(int x,int y)
{
	return a[x]<a[y];
}
int q[N],top,nq[N];
void check(int l,int r)
{
	int nt=r-l+1;
	if(nt<k)return ;
	rep(i,l,r)nq[i-l+1]=a[i];
	int can=nt-k+1;
	nth_element(nq+1,nq+can,nq+nt+1);
	rep(i,1,can)q[++top]=nq[i];
}
void check(int x)
{
	top=0;
	int last=0;
	mark[n+1]=1;
	rep(i,1,n+1)
	if(mark[i])
	{
		check(last+1,i-1);
		last=i;
	}
	if(top<m){cout<<ans;exit(0);}
	nth_element(q+1,q+m,q+top+1);
	chmin(ans,q[m]-a[x]);
	mark[x]=1;	
}

int main()
{
	//freopen("1.in","r",stdin);
	cin>>n>>k>>m;
	rep(i,1,n)scanf("%d",a+i);
	rep(i,1,n)b[i]=i;
	sort(b+1,b+n+1,a_xiao);
	ans=1e9;
	rep(i,1,n)check(b[i]);
	cout<<ans;
}