#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;
using ll = long long;
static const ll INF = 1000000000000000000ll;

int main(){
	ios_base::sync_with_stdio(false);
	int n, k, q;
	cin >> n >> k >> q;
	vector<ll> a(n);
	for(int i = 0; i < n; ++i){ cin >> a[i]; }
	ll answer = INF;
	for(int i = 0; i < n; ++i){
		vector<vector<ll>> b;
		b.emplace_back();
		for(int j = 0; j < n; ++j){
			if(a[j] >= a[i]){
				b.back().push_back(a[j]);
			}else if(!b.back().empty()){
				b.emplace_back();
			}
		}
		if(b.back().empty()){
			b.pop_back();
		}
		vector<ll> c;
		for(auto& v : b){
			const int m = v.size();
			sort(v.begin(), v.end());
			for(int j = 0; j + k <= m; ++j){
				c.push_back(v[j]);
			}
		}
		sort(c.begin(), c.end());
		if(c.size() >= q){
			answer = min(answer, c[q - 1] - c[0]);
		}
	}
	cout << answer << endl;
	return 0;
}

