#include <bits/stdc++.h>

using namespace std;

#define REP(i,m) for(int i=0; i<m; i++)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define INF 1000000001
#define INFL (1LL << 60)
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define ll long long int
#define P pair<ll, ll>

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  P a[n];
  REP(i, n){
    int x;
    cin >> x;
    a[i] = {x, i};
  }
  sort(a, a+n);
  bool check[n];
  REP(i, n){
    check[i] = ((n-k-q+i+1 <= a[i].second) && (a[i].second <= k+q-i-2));
  }
  bool isok[n-q+1] = { };
  REP(i, n-q+1){
    REP(j, n){
      if(check[j] && !(i <= j && j < i+q)) isok[i] = true;
    }
  }
  int mm[n-q+1];
  REP(i, n-q+1) mm[i] = a[i+q-1].first - a[i].first;
  int ans = INF;
  REP(i, n-q+1){
    if(!isok[i]) ans = min(ans, mm[i]);
  }
  cout << ans << endl;
  return 0;
}
