#include<bits/stdc++.h>

using namespace std;

#define N 3000
#define INF 0x3f3f3f3f

int n,m,p,ans,a[N],b[N],c[N];

int main(){
	scanf("%d%d%d",&n,&m,&p);
	for (int i=1;i<=n;++i) scanf("%d",&a[i]);
	ans=INF;
	for (int i=1;i<=n;++i){
		int xb=0,tot=0;
		for (int j=1;j<=n;++j)
			if (a[j]>=a[i]) b[++xb]=a[j];
			else{
				sort(b+1,b+xb+1);
				for (int k=1;k+m-1<=xb;++k) c[++tot]=b[k];
				xb=0;
			}
		sort(b+1,b+xb+1);
		for (int k=1;k+m-1<=xb;++k) c[++tot]=b[k];
		if (tot>=p){
			sort(c+1,c+tot+1);
			ans=min(ans,c[p]-c[1]);
		}
	}
	printf("%d\n",ans);
	
	return 0;
}
			