#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <sstream>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#include <list>
#include <numeric>
#include <bitset>
#include <ext/algorithm>
#include <ext/numeric>
#define ffor(_a,_f,_t) for(int _a=(_f),__t=(_t);_a<__t;_a++)
#define all(_v) (_v).begin() , (_v).end()
#define sz size()
#define pb push_back
#define SET(__set, val) memset(__set, val, sizeof(__set))
#define FOR(__i, __n) ffor (__i, 0, __n)
typedef long long LL; using namespace std;
typedef pair<int, char> ICpair;

int a[5000];
vector<int> vals;

int N, K, Q;

int main() {
	ios_base::sync_with_stdio(false);
	vals.clear();
	cin >> N >> K >> Q;
	FOR (i, N) {
		cin >> a[i];
		vals.pb(a[i]);
	}
	sort(all(vals));
	LL ret = -1;
	FOR (curr, N - Q + 1) {
		int v = vals[curr];
		vector<int> toUse;
		vector<int> current;
		int i = 0, j;
		while (i < N) {
			j = i + 1;
			while (j < N && a[j] >= v)
				j++;
			current.clear();
			ffor (k, i, j)
				current.pb(a[k]);
			sort(all(current));
			FOR (k, current.sz - K + 1)
				toUse.pb(current[k]);
			i = j;
		}
		sort(all(toUse));
		if (toUse.sz < Q)
			continue;
		LL tmp = toUse[Q - 1] - toUse[0];
		if (ret == -1 || tmp < ret)
			ret = tmp;
	}
	
	cout << ret << endl;
	return 0;
}