#include <bits/stdc++.h>
using namespace std;
#define int long long   // aaaaaaaaaaaaaaaaaa
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(),(x).rend()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef long long ll;
typedef pair<int,int> PII;
const ll mod=1000000007;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
template<typename T, typename U>ostream& operator << (ostream& os, pair<T, U>& pair_var)
{os << "(" << pair_var.first << ", " << pair_var.second << ")";return os;}
// head

int n,k,q,res;
int a[2100]= {};
int c[1000][1000] = {};
int dp[2020][2020] = {};
int hidari[2][2020] = {};
int wpos[2020][2020] = {};
int bpos[2020][2020] = {};
string s;
int mi = 1LL<<30;
vector<pair<char,int> > vec;
signed main() {
	std::cin >>n>>k>>q;
	rep(i,0,n){
		std::cin >> a[i];
	}
	rep(i,0,n){
  VI V;
	VI P;
	int syo = a[i];
	rep(j,0,n){
		if(syo<=a[j]){
			V.pb(a[j]);
		}
		else{
			if(V.size()>=k){
				sort(all(V));
				rep(l,0,V.size()-k+1){
					P.pb(V[l]);
				}
				V.clear();
			}
		}
	}
	if(V.size()>=k){
		sort(all(V));
		rep(l,0,V.size()-k+1){
			P.pb(V[l]);
		}
		V.clear();
	}
	if(P.size()>=q){
		sort(all(P));
		mi = min(mi,P[q-1]-P[0])
	}
}
	std::cout << mi << '\n';
	
}
