#include <stdio.h>
#include <queue>
#include <set>
#include <algorithm>
#include <vector>
#include <functional>
using namespace std;
#define N (2001)
set<int> s;
int f[N];
int main(){
	int n, k, Q, ans=1e9;
	scanf("%d %d %d", &n, &k, &Q);
	for(int i=1; i<=n; i++){
		scanf("%d", &f[i]);
		s.insert(f[i]);
	}
	s.insert(0);
	for(auto it=s.begin(); it!=s.end(); it++){
		int val = *it;
		priority_queue<int, vector<int>, greater<int> > q, tmp_q;
		for(int i=1; i<=n+1; i++){
			if(f[i] > val && i != n+1)tmp_q.push(f[i]);
			else{
				int how = tmp_q.size() - k + 1;
				for(int j=0; j<how; j++){
					q.push(tmp_q.top());
					tmp_q.pop();
				}
				while(tmp_q.size())tmp_q.pop();
			}
		}
		if(q.size() < Q)break;
		int mini = q.top(), maxi=0, iter=Q;
		while(q.size() && iter--){maxi=q.top();q.pop();}
		ans = min(ans, maxi-mini);
	}
	printf("%d\n", ans);
	return 0;
}