#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int n,k,q,a[2005],ans=0x7fffffff,b[2005],c[2005],d[2005],t,l,r;
inline int min(int x,int y){
	return x<y?x:y;
}
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);
    for(int i=1;i<=n;i++){
    	t=b[i],l=1,r=1;
	    c[0]=0;
	    while(l<=n){
	        while(a[l]<t&&l<=n) l++;
	        d[0]=0,r=l;
	        while(a[r]>=t&&r<=n) r++;
	        for(int i=l;i<r&&i<=n;i++) d[++d[0]]=a[i];
	        if(d[0]>=k){
	            sort(d+1,d+d[0]+1);
	            for(int i=1;i<=d[0]-k+1;i++) c[++c[0]]=d[i];
	        }
	        l=r;
	    }
	    sort(c+1,c+c[0]+1);
	    if(c[0]>=q) ans=min(ans,c[q]-c[1]);
    }
    printf("%d\n",ans);
    return 0;
}