
#include<bits/stdc++.h>
using namespace std;
int a[2005],b[2005],c[2005];
int n,k,q,ans;
int main(){
	scanf("%d%d%d",&n,&k,&q);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	ans=1e9+1;
	for (int i=1;i<=n;i++){
		int l=0;
		int cnt=0;
		for (int j=1;j<=n+1;j++)
			if (a[j]<a[i]){
				if (!l) continue;
				int r=j-1; 
				for (int p=l;p<=r;p++)
					b[p]=a[p];
				sort(b+l,b+r+1);
				for (int p=l;p+k-1<=r;p++)
					c[++cnt]=b[p];
				l=0;
			}
			else if (!l) l=j;
		if (cnt<q) continue;
		sort(c+1,c+cnt+1);
		//printf("%d\n",c[q]);
		ans=min(ans,c[q]-a[i]);
	}
	printf("%d\n",ans);
}