import std.algorithm;
import std.array;
import std.container;
import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int solve (int n, int k, int q)
{
	readln;
	auto a = readln.splitter.map !(to !(int)).array;
	auto p = n.iota.array;
	makeIndex (a, p);
	int res = int.max / 2;
	for (int skips = 0; n - (skips + q) >= k - 1; skips++)
	{
		auto s = redBlackTree !(int) ();
		s.insert (-1);
		s.insert (n);
		foreach (i; 0..skips)
		{
			s.insert (p[i]);
		}
		auto t = new int [n + 2];

		int fenSum (int v)
		{
			int res = 0;
			for (v += 1; v > 0; v -= (v & -v))
			{
				res += t[v];
			}
			return res;
		}

		void fenAdd (int v)
		{
			for (v += 1; v < n; v += (v & -v))
			{
				t[v] += 1;
			}
		}

		int inf = int.max / 2;
		int sup = int.min / 2;
		int acc = 0;
		foreach (i; skips..n)
		{
			int cur = p[i];
			auto lo = s.lowerBound (cur).back;
			auto hi = s.upperBound (cur).front;
			auto used = fenSum (hi) - fenSum (lo);
			if (hi - lo - 1 - used >= k)
			{
				fenAdd (cur);
				sup = max (sup, a[cur]);
				inf = min (inf, a[cur]);
				acc += 1;
				if (acc == q)
				{
					break;
				}
			}
		}
		if (acc >= q)
		{
			res = min (res, sup - inf);
		}
	}
	return res;
}

void main ()
{
	int n, k, q;
	while (readf (" %s %s %s", &n, &k, &q) > 0)
	{
		writeln (solve (n, k, q));
	}
}
