#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <algorithm>
#include <queue>
#include <string> 
#include <map>
#include <iomanip>
#include <list>
#include <stack>
#include <bitset>
#include <cmath>
using namespace std;


typedef int INT;
#define int long long

int c[2000];

INT main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	int n, k, q;
	cin >> n >> k >> q;
	vector <int> a(n);
	for (int i = 0; i < n; i++)
		cin >> a[i]; 
	vector <int> b = a;

	sort(b.begin(), b.end());
	int cur = -1;
	for (int i = 0; i < n; i++)
	{
		vector <int> v;
		int vb = b[i];
		for (int j = 0; j < n; j++)
			c[j] = a[j];
		int l = -1, r = -1;
		for (int j = 0; j < n; j++)
		{
			if (a[j] >= vb)
			{
				if (l == -1)
					l = j;
			}
			else
			{
				if (l != -1)
				{
					r = j - 1;
					sort(c + l, c + r);
					for (int u = l; u <= r - k + 1; u++)
					{
						v.push_back(c[u]);
					}
					l = -1;
				}
			}
		}
		if (l != -1)
		{
			r = n - 1;
			sort(c + l, c + r + 1);
			for (int u = l; u <= r - k + 1; u++)
			{
				v.push_back(c[u]);
			}
			l = -1;
		}
		sort(v.begin(), v.end());
		if (v.size() >= q)
		{
			if (cur == -1 || v[q - 1] - v[0] < cur)
				cur = v[q - 1] - v[0];
		}
	}
	cout << cur;


	return 0;
}