#include <queue>
#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

const int maxn = 2e3 + 10;
const int inf = 2e9;

int n, k, q;
int a[maxn], b[maxn];
bool ban[maxn];
int ans = inf;

void Doit()
{
	vector<int> c, d;
	for (int i = 1; i <= n + 1; ++ i)
	{
		if (ban[i])
		{
			if (c.size() >= k)
			{
				sort(c.begin(), c.end());
				int p = c.size() - k + 1;
				for (int i = 0; i < p; ++ i) d.push_back(c[i]);
			}
			c.clear();
			continue;
		}
		c.push_back(a[i]);
	}
	sort(d.begin(), d.end());
	if (d.size() < q) return;
	ans = min(ans, d[q - 1] - d[0]);
}

int main()
{
	scanf("%d%d%d", &n, &k, &q);
	for (int i = 1; i <= n; ++ i)
	{
		scanf("%d", a + i);
		b[i] = a[i];
	}
	sort(b + 1, b + n + 1);
	ban[n + 1] = true;
	for (int i = 1; i <= n; ++ i)
	{
		for (int j = 1; j <= n; ++ j)
			ban[j] = a[j] < b[i];
		Doit();
	}
	printf("%d\n", ans);
	return 0;
}
