#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
using namespace std;

typedef long long ll;


int main() {
	int N, K, Q; cin >> N >> K >> Q;
	vector<int> a(N + 2);
	for (int i = 0; i < N; i++) cin >> a[i];
	a[N] = -1;
	int ans = 1e9;
	for (int i = 0; i < N; i++) {
		vector<int> q;
		int left = 0, right = 0;
		while (right <= N) {
			if (a[right] < a[i]) {
				priority_queue<int> que;
				for (int j = left; j < right; j++) que.push(-a[j]);
				for (int j = 0; j <= right - left - K; j++) q.push_back(-que.top()), que.pop();
				left = right + 1;
			}
			right++;
		}
		sort(q.begin(), q.end());
		if ((int)q.size() >= Q) ans = min(ans, q[Q - 1] - a[i]);
	}
	cout << ans << endl;
	return 0;
}