#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
static const int MAX_N = 2000;
static const int MAX_A = 1000000000;
 
int N, K, Q;
int A[MAX_N];
 
int main(){
	cin >> N >> K >> Q;
	for(int i = 0; i < N; i++) cin >> A[i];
	int ans = MAX_A + 1;
	for(int i = 0; i < N; i++){
		int Y = A[i];
		int cnt = 0;
		vector<int> va, vb;
		for(int j = 0; j < N; j++){
			if(A[j] >= A[i] && j != N - 1){
				va.push_back(A[j]);
			}else{
				if(A[j] >= A[i] && j == N - 1) va.push_back(A[j]);
				if(va.size() < K){
					va.clear();
					continue;
				}
				sort(va.begin(), va.end());
				for(int l = 0; l < va.size() - K + 1; l++){
					vb.push_back(va[l]);
				}
				va.clear();
			}
		}
		sort(vb.begin(), vb.end());
		if(vb.size() >= Q) ans = min(ans, vb[Q - 1] - Y);
	}
	cout << ans << endl;
	return 0;
}