#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define rep(i,a,b) for (int i = (a); i < (b); i++)
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef complex<double> com;
const int mod = 1e9 + 7;
const int MOD = 998244353;
const int inf = 2e9;



int main() {
	int n, k, q; cin >> n >> k >> q;
	vector<int> a(n+1);
	rep(i, 0, n) cin >> a[i];
	a[n] = -1; int ans = inf;
	rep(i, 0, n) {
		vector<int> b, c;
		rep(j, 0, n+1) {
			if (a[j] < a[i]) {
				sort(b.begin(), b.end());
				rep(l, 0, (int)b.size() - k + 1) c.push_back(b[l]);
				b = {};
			}
			else b.push_back(a[j]);
		}
		if (c.size() < q) continue;
		sort(c.begin(), c.end());
		ans = min(ans, c[q - 1] - c[0]);
	}
	printf("%d", ans);
	return 0;
}
