#include <bits/stdc++.h>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;

const int INF = 1e9;
const ld EPS = 1e-8;

int main(){
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(N);
  REP(i,N) cin >> A[i];

  int ret = INF;
  for(int bound: A) {
    vector<int> tmp;
    multiset<int> ms;
    REP(i,N + 1) {
      if(i == N || A[i] < bound) {
        sort(ALL(tmp));
        REP(j, tmp.size() - K + 1) ms.insert(tmp[j]);
        tmp.clear();
      }else{
        tmp.push_back(A[i]);
      }
    }
    if(ms.size() < Q) continue;
    auto itr = ms.begin();
    REP(i,Q - 1) itr++;
    ret = min(ret, *itr - bound);
  }
  cout << ret << endl;
  return 0;
}

