#include <bits/stdc++.h>
using namespace std;
signed main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  long long n;
  cin >> n;
  ;
  long long k;
  cin >> k;
  ;
  long long q;
  cin >> q;
  ;
  ;
  ;
  vector<long long> data(n);
  vector<pair<long long, long long> > table(n);
  for (long long i = 0; i < n; i++) {
    cin >> data[i];
    table[i].first = data[i];
    table[i].second = i;
  }
  sort((table).begin(), (table).end());
  vector<long long> state(n, 0);
  long long ret = 1001000100010001000;
  for (long long i = 0; i < n; i++) {
    vector<long long> funami, yui;
    long long bef = 0;
    for (long long j = 0; j < n; j++) {
      if (state[j]) {
        sort((yui).begin(), (yui).end());
        reverse((yui).begin(), (yui).end());
        for (long long ptr = k - 1; ptr < yui.size(); ptr++) {
          funami.push_back(yui[ptr]);
        }
        yui.assign(0, 0);
        bef = j;
      } else {
        yui.push_back(data[j]);
      }
    }
    sort((yui).begin(), (yui).end());
    reverse((yui).begin(), (yui).end());
    for (long long ptr = k - 1; ptr < yui.size(); ptr++) {
      funami.push_back(yui[ptr]);
    }
    sort((funami).begin(), (funami).end());
    long long ans = 1001000100010001000;
    for (long long j = 0; j + q - 1 < funami.size(); j++) {
      ans = min(ans, funami[j + q - 1] - funami[j]);
    }
    ret = min(ret, ans);
    state[table[i].second] = 1;
  }
  assert(ret != 1001000100010001000);
  cout << ret << endl;
  return 0;
}
