#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a) for(int i=0;i<(a);i++)
const ll MOD=1000000007;

int N,K,Q;
ll A[2020];
const ll INF=LLONG_MAX/2;

int main(){
  cin>>N>>K>>Q;
  rep(i,N) cin>>A[i];
  ll ans=INF;
  rep(i,N){
    int l=0;
    vector<ll> v,tmp;
    rep(j,N){
      if(A[j]<A[i]){
        if(tmp.size()>=K){
          sort(tmp.begin(),tmp.end());
          rep(k,tmp.size()-K+1) v.push_back(tmp[k]);
        }
        tmp.clear();
      }else{
        tmp.push_back(A[j]);
      }
    }
    if(tmp.size()>=K){
      sort(tmp.begin(),tmp.end());
      rep(k,tmp.size()-K+1) v.push_back(tmp[k]);
    }
    sort(v.begin(),v.end());
    if(v.size()<Q) continue;
    else ans=min(ans,v[Q-1]-v[0]);
  }
  cout<<ans<<endl;
  return 0;
}
