#include "omp.h"
#include <iostream>
#include <iomanip>
#include <string>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <vector>
#include <cassert>
#include <fstream>
#include <algorithm>
#include <list>
#include <random>
#include <ctime>
#include <random>
#include <bitset>
#include <unordered_set>
#include <cassert>
#include <list>


using namespace std;

typedef long long ll;
typedef long double ld;


const int sze = 1 << 10, INF = 1e9 + 10;


int n, k, q;


bool check(int up, int down, const vector<int> values)
{
	multiset<int> challengers;
	int l = 0, r = 0, cnt = 0;

	while (l < n)
	{
		while (r < n && challengers.size() < k)
		{
			challengers.insert(values[r]);
			r++;
		}

		if (challengers.size() != k)
			break;

		int vl = *challengers.begin();
		if (vl <= up && vl >= down)
		{
			cnt++;
			auto it = challengers.lower_bound(vl);
			challengers.erase(it);//по итератору
		}
		else
		{
			auto it = challengers.lower_bound(values[l]);
			if (it != challengers.end())
				challengers.erase(it);//По итератору
			
			l++;
		}
	}

	return cnt >= q;
}


signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	cin >> n >> k >> q;

	vector<int> values(n), challengers;
	
	for (int i = 0; i < n; ++i)
		cin >> values[i];

	challengers = values;
	sort(challengers.begin(), challengers.end());

	int M = unique(challengers.begin(), challengers.end()) - challengers.begin();
	challengers.resize(M);

	challengers.erase(unique(challengers.begin(), challengers.end()), challengers.end());

	int ans = INF;
	int m = challengers.size();
	for (int i = 0; i < m; ++i)
	{
		int l = i - 1, r = m;

		while (r - l > 1)
		{
			int mid = (l + r) >> 1;
			int up = challengers[mid], down = challengers[i];

			if (check(up, down, values))
				r = mid;
			else
				l = mid;
		}

		if (r != m)
			ans = min(ans, challengers[r] - challengers[i]);
	}

	cout << ans;
	return 0;
}
