#include <bits/stdc++.h>
using namespace std;
class RSQ {
 public:
  RSQ(int n) {
    _n = 1;
    while (_n < n) _n *= 2;
    _dat.resize(2 * _n - 1);
    for (int i = 0; i < 2 * _n - 1; ++i) _dat[i] = 0;
  }
  int size() { return _n; }
  void update(int k, long long a) {
    k += _n - 1;
    _dat[k] += a;
    while (k > 0) {
      k = (k - 1) / 2;
      _dat[k] += a;
    }
  }
  long long query(int a, int b, int k = 0, int l = 0, int r = -1) {
    if (r == -1) r = _n;
    if (r <= a || b <= l) return 0;
    if (a <= l && r <= b)
      return _dat[k];
    else {
      long long vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
      long long vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
      return vl + vr;
    }
  }

 private:
  int _n;
  vector<long long> _dat;
};
class RMQ {
 public:
  RMQ(int n) {
    _n = 1;
    while (_n < n) _n *= 2;
    _dat.resize(2 * _n - 1);
    for (int i = 0; i < 2 * _n - 1; ++i) _dat[i] = (((1ll << 60) - 1));
  }
  int size() { return _n; }
  void update(int k, long long a) {
    k += _n - 1;
    _dat[k] = a;
    while (k > 0) {
      k = (k - 1) / 2;
      _dat[k] = min(_dat[k * 2 + 1], _dat[k * 2 + 2]);
    }
  }
  long long query(int a, int b, int k = 0, int l = 0, int r = -1) {
    if (r == -1) r = _n;
    if (r <= a || b <= l) return ((1ll << 60) - 1);
    if (a <= l && r <= b)
      return _dat[k];
    else {
      long long vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
      long long vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
      return min(vl, vr);
    }
  }

 private:
  int _n;
  vector<long long> _dat;
};
RSQ rsq(2020);
RMQ rmq(2020);
vector<long long> sorted;
vector<long long> a;
long long n, k, q;
bool ers(long long pos) {
  long long l1 = sorted[pos], r1 = -1;
  while (l1 - r1 > 1) {
    long long m1 = (l1 + r1) / 2;
    if (rmq.query(m1, pos) >= a[sorted[pos]]) {
      l1 = m1;
    } else {
      r1 = m1;
    }
  }
  long long l2 = sorted[pos], r2 = n;
  while (r2 - l2 > 1) {
    long long m2 = (l2 + r2) / 2;
    if (rmq.query(pos, m2) >= a[sorted[pos]])
      l2 = m2;
    else
      r2 = m2;
  }
  if ((l2 - l1 + 1) - rsq.query(l1, l2 + 1) >= k) {
    rsq.update(sorted[pos], 1);
    rmq.update(sorted[pos], 1000000000ll * 1000000000ll);
    return true;
  } else
    return false;
}
long long calc(long long mini_idx) {
  long long pos = mini_idx;
  long long ret = 0;
  while (pos < n && ret < q) {
    if (ers(pos)) {
      ret++;
    }
    pos++;
  }
  for (long long i = 0; i < (long long)n; i++)
    rsq.update(i, -rsq.query(i, i + 1));
  for (long long i = 0; i < (long long)n; i++) rmq.update(i, a[i]);
  if (ret == q)
    return a[sorted[pos - 1]];
  else
    return -1;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k >> q;
  a.resize(n);
  for (long long i = 0; i < (long long)n; i++) cin >> a[i];
  vector<pair<long long, long long> > b(n);
  sorted.resize(n);
  for (long long i = 0; i < (long long)n; i++) {
    b[i].first = a[i];
    b[i].second = i;
  }
  sort(b.begin(), b.end());
  for (long long i = 0; i < (long long)n; i++) sorted[i] = b[i].second;
  for (long long i = 0; i < (long long)n; i++)
    rsq.update(i, -rsq.query(i, i + 1));
  for (long long i = 0; i < (long long)n; i++) rmq.update(i, a[i]);
  long long ans = 1000000000ll * 1000000000ll;
  for (long long i = 0; i < (long long)n; i++) {
    long long buf = calc(i);
    if (buf != -1) ans = min(ans, buf - a[sorted[i]]);
  }
  cout << ans << endl;
}
