#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
const int inf = 1.01e9;
const i64 inf64 = 4.01e18;
const double eps = 1e-9;
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "[";
  for (const auto &v : vec) {
    os << v << ",";
  }
  os << "]";
  return os;
}
template <class T, T op(T, T)>
class segtree {
 public:
  int n, size_;
  vector<T> dat;
  T id_;
  segtree() = default;
  segtree(int size, T id, T initial_value) { init(size, id, initial_value); }
  void init(int size, T id, T initial_value) {
    size_ = size;
    id_ = id;
    n = 1;
    while (n < size) n *= 2;
    dat.assign(2 * n - 1, id);
    for (int i = 0; i < size; ++i) update(i, initial_value);
  }
  int size() const { return size_; }
  void update(int k, T a) {
    k += n - 1;
    dat[k] = a;
    while (k > 0) {
      k = (k - 1) / 2;
      dat[k] = op(dat[k * 2 + 1], dat[k * 2 + 2]);
    }
  }
  T at(int index) { return dat[index + n - 1]; }
  void add(int k, T a) { update(k, at(k) + a); }
  T query(int a, int b) { return query(a, b, 0, 0, n); }
  T query(int a, int b, int k, int l, int r) {
    if (r <= a or b <= l) return id_;
    if (a <= l and r <= b) return dat[k];
    int m = (l + r) / 2;
    return op(query(a, b, k * 2 + 1, l, m), query(a, b, k * 2 + 2, m, r));
  }
};
i64 mymax(i64 a, i64 b) { return max(a, b); }
void solve() {
  i64 N, K, Q;
  cin >> N >> K >> Q;
  vector<i64> A(N);
  vector<pair<i64, int>> ps;
  for (i64 i = i64(0), i_max_for_repmacro = i64(N); i < i_max_for_repmacro;
       ++i) {
    cin >> A[i];
    ps.push_back(make_pair(A[i], i));
  }
  sort(begin(ps), end(ps));
  i64 ans = inf64;
  for (i64 i = i64(0), i_max_for_repmacro = i64(N); i < i_max_for_repmacro;
       ++i) {
    i64 lb = ps[i].first;
    vector<int> ls, rs;
    {
      int l = 0;
      while (A[l] < lb) ++l;
      for (i64 j = i64(l), j_max_for_repmacro = i64(N); j < j_max_for_repmacro;
           ++j) {
        if (A[j] < lb and l != -1) {
          ls.push_back(l);
          rs.push_back(j);
          l = -1;
          continue;
        }
        if (A[j] < lb) continue;
        if (l == -1) l = i;
      }
      if (l != -1) {
        ls.push_back(l);
        rs.push_back(N);
      }
    }
    priority_queue<i64> que;
    for (i64 j = i64(0), j_max_for_repmacro = i64(ls.size());
         j < j_max_for_repmacro; ++j) {
      int l = ls[j], r = rs[j];
      if (r - l < K) continue;
      int cap = r - l - K + 1;
      priority_queue<i64> local;
      for (i64 j = i64(l), j_max_for_repmacro = i64(r); j < j_max_for_repmacro;
           ++j) {
        local.push(A[j]);
        if (local.size() > cap) local.pop();
      }
      while (local.size()) {
        i64 tmp = local.top();
        local.pop();
        que.push(tmp);
        if (que.size() > Q) que.pop();
      }
    }
    if (que.size() < Q) continue;
    ;
    cerr << ls << endl;
    cerr << rs << endl;
    i64 mi = inf64, ma = 0;
    while (que.size()) {
      i64 tmp = que.top();
      que.pop();
      mi = min(mi, tmp);
      ma = max(ma, tmp);
    };
    ;
    ;
    ans = min(ans, ma - mi);
  }
  cout << ans << endl;
}
int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  cout.setf(ios::fixed);
  cout.precision(16);
  solve();
  return 0;
}
