#include <bits/stdc++.h>
using namespace std;
int main() {
	int N, K, Q;
	cin >> N >> K >> Q;
	vector<int> A(N);
	set<int> B;
	for (auto& x : A) {
		cin >> x;
		B.insert(x);
	}
	int r = 1<<30;
	for (int x : B) {
		vector<vector<int>> aa;
		int c = 0;
		for (int i = 0; i < N; ++ i) {
			if (A[i] >= x) {
				++ c;
				if (c == K) {
					aa.push_back(vector<int>());
					for (int j = i-c+1; j <= i; ++ j) aa.back().push_back(A[j]);
				} else if (c > K) {
					aa.back().push_back(A[i]);
				}
			} else {
				c = 0;
			}
		}
		vector<int> b;
		for (auto& a : aa) {
			sort(a.begin(), a.end());
			for (int i = 0; i+K <= (int)a.size(); ++ i) b.push_back(a[i]);
		}
		if (Q > (int)b.size()) break;
		sort(b.begin(), b.end());
		r = min(r, b[Q-1] - b[0]);
	}
	cout << r << endl;
}
