#include<bits/stdc++.h>
using namespace std;

#define x first
#define y second

int n, k, q, a[2055], ans = 1023456789;

int solve(int x) {
	vector<int> cur, num;
	for (int i = 0; i < n; i++) {
		if (a[i] < x) {
			if (cur.size() >= k) {
				sort(cur.begin(), cur.end());
				for (int j = 0; j < cur.size() - k + 1; j++)
					num.push_back(cur[j]);
			}
			cur.clear();
		} else {
			cur.push_back(a[i]);
		}
	}
	
	if (cur.size() >= k) {
		sort(cur.begin(), cur.end());
		for (int j = 0; j < cur.size() - k + 1; j++)
			num.push_back(cur[j]);
	}
	
	if (num.size() >= q) {
		sort(num.begin(), num.end());
		return num[q - 1] - num[0];
	} else
		return 1023456789;
	
}

int main () {
	
	scanf("%d%d%d", &n, &k, &q);
	
	for (int i = 0; i < n; i++) 
		scanf("%d", a + i);
	
	for (int i = 0; i < n; i++) 
		ans = min(ans, solve(a[i]));
	
	printf("%d\n", ans);
	
	return 0;
}