#include <bits/stdc++.h>
using namespace std;
using tpl = tuple<int, int, int>;
void fastStream() {
  cin.tie(0);
  std::ios_base::sync_with_stdio(0);
}
class RMQ {
 public:
  int n;
  vector<int> dat;
  void init(int n_) {
    n = 1;
    while (n < n_) n *= 2;
    dat.resize(n * 2 - 1, INT_MAX);
  }
  void update(int k, int 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]);
    }
  }
  int _query(int a, int b, int k, int l, int r) {
    if (r <= a || b <= l)
      return INT_MAX;
    else if (a <= l && r <= b)
      return dat[k];
    int vl = _query(a, b, k * 2 + 1, l, (l + r) / 2);
    int vr = _query(a, b, k * 2 + 2, (l + r) / 2, r);
    return min(vl, vr);
  }
  int query(int a, int b) { return _query(a, b, 0, 0, n); }
};
int N, K, Q;
int A[2010];
RMQ rmq;
int main() {
  cin >> N >> K >> Q;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  rmq.init(N);
  int max_a = INT_MIN;
  int min_a = INT_MAX;
  for (int i = 0; i < N; i++) {
    min_a = min(min_a, A[i]);
    max_a = max(max_a, A[i]);
    rmq.update(i, A[i]);
  }
  int ans = max_a - min_a;
  for (int i = 0; i < N; i++) {
    int c = 0;
    for (int j = 0; j < N; j++) {
      if (A[i] >= A[j]) {
        c++;
      }
    }
    if (c < Q) {
      continue;
    }
    int max_pos = i;
    vector<int> overs;
    for (int j = 0; j < N; j++) {
      if (A[j] >= A[max_pos]) {
        overs.push_back(j);
      }
    }
    if ((int)overs.size() >= K) {
      deque<int> dq;
      bool ok = false;
      for (int j = 0; j < (int)overs.size(); j++) {
        if ((int)dq.size() < K) {
          dq.push_back(overs[j]);
          if (overs[j] == i) {
            ok = true;
          }
        }
        if ((int)dq.size() == K) {
          if (ok) {
            int pos1 = dq[0];
            int pos2 = dq[K - 1];
            int cnt = pos2 - pos1 + 1 - K;
            if (cnt < Q) {
              ans = min(ans, A[i] - min_a);
            } else if (cnt == Q) {
              ans = min(ans, A[i] - rmq.query(pos1, pos2 + 1));
            }
            if (dq[0] == i) break;
            dq.pop_front();
          } else {
            dq.pop_front();
          }
        }
      }
    } else {
      continue;
    }
  }
  cout << ans << endl;
}
