#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

int n,k,q,ans;
int a[2010],b[2010],c[2010];

int main(){
	cin >> n >> k >> q;
	int i,j;
	for(i=1;i<=n;i++){
		cin >> a[i];
	}
	ans = 1e9;
	for(i=1;i<n+1;i++){
		int l = 0;
		int cnt = 0;
		for(j=1;j<=n+1;j++){
			if(a[j]<a[i]){
				if(l==0){
					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++){
					cnt++;
					c[cnt]=b[p];
				}
				l=0;
			}
			else if (l==0){
				l=j;
			}
		}
			if (cnt<q) {
				continue;
			}
			sort(c+1,c+cnt+1);
			ans=min(ans,c[q]-a[i]);
	}
		cout << ans << endl;
}

