#include <bits/stdc++.h>
using namespace std;
template<typename T>
inline T read(T&x){
	x=0;int f=0;char ch=getchar();
	while (ch<'0'||ch>'9') f|=(ch=='-'),ch=getchar();
	while (ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
	return x=f?-x:x;
}
const int N=2000+10;
int n,K,q,i,j,k,cnt,a[N],b[N],res[N];
int main(){
	read(n),read(K),read(q);
	for (i=1;i<=n;i++) read(a[i]);
	int ans=1000000000+7;
	for (i=1;i<=n;i++){
		int l=0;
		for (cnt=0,j=1;j<=n+1;j++){
			if (a[j]<a[i]){
				if (!l) continue;
				int r=j-1;
				for (k=l;k<=r;k++) b[k]=a[k];
				sort(b+l,b+r+1);
				for (k=l;k+K-1<=r;k++) res[++cnt]=b[k];
				l=0;
			}
			else if (!l) l=j;
		}
		if (cnt<q) continue;
		sort(res+1,res+cnt+1);
		ans=min(ans,res[q]-a[i]);
	}
	printf("%d\n",ans);
	return 0;
}
