#include <bits/stdc++.h>
#define GET_MACRO(_1,_2,_3,_4,_5,_6,NAME,...) NAME
#define pr(...) cerr<< GET_MACRO(__VA_ARGS__,pr6,pr5,pr4,pr3,pr2,pr1)(__VA_ARGS__) <<endl
#define pr1(a) (#a)<<"="<<(a)<<" "
#define pr2(a,b) pr1(a)<<pr1(b)
#define pr3(a,b,c) pr1(a)<<pr2(b,c)
#define pr4(a,b,c,d) pr1(a)<<pr3(b,c,d)
#define pr5(a,b,c,d,e) pr1(a)<<pr4(b,c,d,e)
#define pr6(a,b,c,d,e,f) pr1(a)<<pr5(b,c,d,e,f)
#define pr7(a,b,c,d,e,f,g) pr1(a)<<pr6(b,c,d,e,f,g)
#define pr8(a,b,c,d,e,f,g,h) pr1(a)<<pr7(b,c,d,e,f,g,h)
using namespace std;
using Int = long long;
using ll = long long;
using Double = long double;
const Int INF = 1LL<<55;
const Int mod = (1e9)+7;
using P = pair<Int,Int>;
using T = tuple<Int,Int,Int>;
const Double EPS = 1e-8;
const Double PI = 6.0 * asin((Double)0.5);
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}
ostream& operator<<(ostream& o,P p){return o<<"("<<p.first<<","<<p.second<<")";}
ostream& operator<<(ostream& o,T t){return o<<"("<<get<0>(t)<<","<<get<1>(t)<<","<<get<2>(t)<<")";}
istream& operator>>(istream& i,P &p){return i>>p.first>>p.second;}
ostream& operator<<(ostream& o,vector<auto> &a){Int i=0;for(auto t:a)o<<(i++?" ":"")<<t;return o;}
istream& operator>>(istream& i,vector<auto> &a){for(auto &t:a)i>>t;return i;}
void prArr(auto a,string s=" "){Int i=0;for(auto t:a)cout<<(i++?s:"")<<t;cout<<endl;}

class RMQ{
public:
  typedef long long ll;
  ll INF = 1LL<<55;
  Int n,n_;
  vector<P> dat;
  Int toMax;

  //初期化
  RMQ(){n=-1;}
  RMQ(Int n_,Int toMax = 0):n_(n_),toMax(toMax){
    n=1;
    while(n<n_)n*=2;
    dat.resize(2*n-1,P(INF,INF));
  }
  
  //k番目の値をaに変更
  void update(Int k,P a){
    //if(toMax) a *= -1;
    k+=n-1;
    dat[k]=a;
    while(k>0){
      k=(k-1)/2;
      dat[k]=min(dat[k*2+1],dat[k*2+2]);
    }
  }
  
  //[a,b)の最小値を求める query(a,b,0,0,n)
  P find(Int a,Int b,Int k,Int l,Int r){
    if(r<=a||b<=l)return P(INF,INF);
    if(a<=l&&r<=b)return dat[k];
    P vl = find(a,b,k*2+1,l,(l+r)/2);
    P vr = find(a,b,k*2+2,(l+r)/2,r);
    return min(vl,vr);
  }

  P find(Int a,Int b){
    assert(a <= b), assert(a <= n_ && b <= n_), assert(a >= 0 && a >= 0);
    return /*(toMax? -1:1) * */ find(a,b,0,0,n);
  }
};



Int sim(Int n,Int K,Int Q, vector<Int> A,Int limit){
  priority_queue<Int,vector<Int>, greater<Int> > num;
  vector<Int> B;
  for(Int i=0;i<n;i++) {
    if(A[i] < limit){
      while((Int)num.size() >= K) B.push_back(num.top()), num.pop();
      while(!num.empty()) num.pop();
    }
    else num.push(A[i]);
  }
  while((Int)num.size() >= K) B.push_back(num.top()), num.pop();
  sort(B.begin(), B.end());
  if((Int)B.size() < Q) return INF;
  return B[Q-1] - B[0];
}

signed main(){
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);
  
  Int n, K, Q;
  cin>>n>>K>>Q;
  vector<Int> A(n);
  cin>>A;

  sort(A.begin(),A.end());
  Int ans = INF;
  for(Int i=0;i<n;i++){
    Min(ans, sim(n,K,Q,A,A[i]));
  }
  cout<<ans<<endl;
  return 0;
}
