#include <bits/stdc++.h>

using namespace std;

using int64 = long long;

const int INF = 1 << 30;

int main() {
  int N, K, Q, A[2000];
  cin >> N >> K >> Q;
  for(int i = 0; i < N; i++) {
    cin >> A[i];
  }
  int ret = INF;
  for(int i = 0; i < N; i++) {
    int low = A[i];
    vector< vector< int > > ok;
    ok.emplace_back(vector< int >());
    for(int j = 0; j < N; j++) {
      if(A[j] < low) {
        ok.emplace_back(vector< int >());
      } else {
        ok.back().emplace_back(A[j]);
      }
    }
    vector< int > ans;
    for(auto &vs : ok) {
      sort(begin(vs), end(vs));
      reverse(begin(vs), end(vs));
      while(vs.size() >= K) {
        ans.emplace_back(vs.back());
        vs.pop_back();
      }
    }
    sort(begin(ans), end(ans));
    if(ans.size() >= Q) ret = min(ret, ans[Q - 1] - low);
  }
  cout << ret << endl;
}