#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <map>
#include <set>
#include <cstring>
#include <string>
#include <cctype>
#include <cassert>
#include <queue>
#include <unordered_set>
#include <unordered_map>

using namespace std;

#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i,n) for(int i = 0; i < (n); i++)
#define repr(i,b,e) for(int i = (b); i <= (e); i++)
#define INF (1001001001)
#define EPS (1e-15)

#define pr(x) do{cerr << (#x) << " = " << (x) << endl;}while(0)
#define pri(x,i) do{cerr << (#x) << "[" << i << "] = " << (x[i]) << endl;}while(0)
#define pra(x) do{rep(__i,(x).size()) pri(x,__i);}while(0)
#define pran(x,n) do{rep(__i,n) pri(x,__i);}while(0)
#define pral(x) do{cerr << (#x) << " =";rep(__i,(x).size()) cerr<<" "<<(x[__i]);cerr<<endl;}while(0)
#define prar(x,b,e) do{repr(__i,b,e) pri(x,__i);}while(0)

typedef long long ll;
typedef pair<int, int> pint;
typedef vector<int> vint;
typedef vector<pint> vpint;

template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {os<<"{"; rep(i,t.size()) {os<<t[i]<<",";} os<<"}"<<endl; return os;}
template<class T,size_t n> ostream& operator<<(ostream &os, const array<T,n> &t) {os<<"{"; rep(i,n) {os<<t[i]<<",";} os<<"}"<<endl; return os;}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class T> inline bool CHMAX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool CHMIN(T &l,const T &r){return l>r?l=r,1:0;}

ll MOD = 1000000007;

function<void(int,int)> tensi_no_3p=[&](int v,int d){
};

int in() {
	int a;
	scanf("%d ", &a);
	return a;
}

int main() {
	int N, K, Q;
	cin >> N >> K >> Q;
	vint A(N); rep(i, N) cin >> A[i];
	vpint AI(N); rep(i, N) AI[i] = mp(A[i], i);
	sort(AI.begin(), AI.end());
	vint i2o(N);
	rep(i, N) rep(k, N) if (AI[k].second == i) {
		i2o[i] = k;
		break;
	}
	
	ll ans = AI[Q - 1].first - AI[0].first;
	for (int Y = 1; Y <= N - Q; Y++) {
		// (left, right]
		int left = Y + Q - 2;
		int right = N;
		if (AI[left + 1].first - AI[Y].first >= ans) continue;
		while (right - left >= 2) {
			int X = (left + right) / 2;
			int count = 0;
			int whole = 0;
			int num = 0;
			rep(i, N) {
				if (i2o[i] < Y) {
					whole += max(0, min(num - K + 1, count));
					count = 0;
					num = 0;
				}
				else {
					num++;
					if (i2o[i] <= X) {
						count++;
					}
				}
			}
			if (whole >= Q) right = X;
			else left = X;
		}
		if (right == N) continue;
		ans = min<ll>(ans, AI[right].first - AI[Y].first);
	}
	cout << ans << endl;
	return 0;
}
