#include <bits/stdc++.h>
using namespace std;
long long a[2010];
vector<pair<long long, long long>> v;
long long kok[2010];
long long pref[2010];
vector<long long> sok;
long long ans = 1e10;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, k, q;
  cin >> n >> k >> q;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    v.push_back({a[i], i});
  }
  sort(v.begin(), v.end());
  long long kak = 0;
  for (long long j = 1; j < n; j++) {
    if (v[j].first != v[j - 1].first && j - kak != 1) {
      random_shuffle(v.begin() + kak, v.begin() + j);
      kak = j;
    }
  }
  for (long long i = 0; i <= n - q; i++) {
    sok.clear();
    for (long long j = 0; j < i; j++) sok.push_back(v[j].second);
    sort(sok.begin(), sok.end());
    for (long long j = 0; j <= n; j++) {
      kok[j] = 0;
      pref[j] = 0;
    }
    for (long long j = i; j < i + q; j++) {
      kok[v[j].second] = 1;
    }
    for (long long j = 1; j <= n; j++) {
      pref[j] = pref[j - 1] + kok[j - 1];
    }
    long long nch = 0;
    bool f = true;
    for (long long j = 0; j < (long long)sok.size(); j++) {
      if (pref[sok[j]] - pref[nch] > 0 &&
          sok[j] - nch - pref[sok[j]] + pref[nch] < k - 1) {
        f = false;
        break;
      }
      nch = sok[j] + 1;
    }
    if (pref[n] - pref[nch] > 0 && n - nch - pref[n] + pref[nch] < k - 1) {
      f = false;
    }
    if (f) ans = min(ans, v[i + q - 1].first - v[i].first);
  }
  cout << ans << endl;
  return 0;
}
