#include <bits/stdc++.h>
using namespace std;
long long larger[2019][2019];
long long lef[2019], rig[2019];
int main() {
  long long n, k, q;
  long long ans = 1000000007;
  cin >> n >> k >> q;
  vector<long long> a;
  a.push_back(-1);
  for (int i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    a.push_back(x);
  }
  a.push_back(-1);
  larger[0][0] = 1;
  larger[n + 1][0] = 1;
  for (int i = 0; i <= n + 1; i++) {
    for (int j = 1; j <= n + 1; j++) {
      if (a[j] >= a[i]) {
        larger[i][j] = larger[i][j - 1] + 1;
      } else {
        larger[i][j] = larger[i][j - 1];
      }
    }
  }
  vector<pair<long long, long long> > sa;
  for (int i = 0; i <= n + 1; i++) {
    sa.push_back(make_pair(a[i], i));
  }
  sort(sa.begin(), sa.end());
  for (int i = 2; i < n + 2 - q; i++) {
    long long flag = 0;
    long long mi = sa[i].first;
    long long ma = sa[i + q - 1].first;
    lef[0] = 0;
    for (int j = 1; j <= n + 1; j++) {
      if (a[j] < mi) {
        lef[j] = j;
      } else {
        lef[j] = lef[j - 1];
      }
    }
    rig[n + 1] = n + 1;
    for (int j = n; j >= 0; j--) {
      if (a[j] < mi) {
        rig[j] = j;
      } else {
        rig[j] = rig[j + 1];
      }
    }
    for (int j = 0; j < q; j++) {
      long long cval = sa[i + j].first;
      long long cpos = sa[i + j].second;
      long long clef = lef[cpos];
      long long crig = rig[cpos];
      long long cnt = larger[cpos][crig - 1] - larger[cpos][clef];
      if (cnt < k) {
        flag = 1;
      }
    }
    if (flag == 0) {
      long long tans = ma - mi;
      if (tans < ans) ans = tans;
    }
  }
  cout << ans << endl;
  return 0;
}
