#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;

template<typename T, typename E> class SegmentTree {
public:
  typedef function<T (T, T)> Operator;
  typedef function<T (T, E)> Apply;

  vector<T> data;
  ll n;        // size of elements (2^x alignment)
  T e;         // identity of monoid
  Operator op; // binary operator of monoid
  Apply apply; // apply effect to monoid

  // construct with size of elements
  SegmentTree(ll _n, T e, Operator op, Apply apply): e(e), op(op), apply(apply) {
    for(n = 1; n < _n; n *= 2);
    data.resize(n * 2 - 1, e);
  }

  // construct with initial values
  SegmentTree(const vector<T> &vec, T e, Operator op, Apply apply): e(e), op(op), apply(apply) {
    for(n = 1; n < vec.size(); n *= 2);
    data.resize(n * 2 - 1, e);
    REP(i, 0, vec.size()) data[i + n - 1] = vec[i];
    for(ll i = n - 2; i >= 0; i--) data[i] = op(data[i * 2 + 1], data[i * 2 + 2]);
  }

  // query for [a, b)
  T query(ll a, ll b) { return query(a, b, 0, 0, n); }
  T query(ll a, ll b, ll k, ll l, ll r) {
    if(r <= a || b <= l) return e;
    if(a <= l && r <= b) return data[k];
    T vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
    T vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
    return op(vl, vr);
  }

  // update value at k
  void update(ll k, E x) {
    k += n - 1;
    data[k] = apply(data[k], x);
    while(k > 0) {
      k = (k - 1) / 2;
      data[k] = op(data[k * 2 + 1], data[k * 2 + 2]);
    }
  }
};

int main(void) {
  ll N, K, Q;
  cin >> N >> K >> Q;
  vector<ll> A(N);
  REP(i, 0, N) cin >> A[i];

  vector<pll> rank(N);
  REP(i, 0, N) rank[i] = pll(A[i], i);
  sort(rank.begin(), rank.end());

  ll ans = (1LL << 60);
  REP(i, 0, N) {
    ll minv = rank[i].first;

    // cerr << "i: " << i << endl;

    SegmentTree<ll, ll>::Operator op_min = [](ll a, ll b) { return min(a, b); };
    SegmentTree<ll, ll>::Operator op_max = [](ll a, ll b) { return max(a, b); };
    SegmentTree<ll, ll>::Operator op_add = [](ll a, ll b) { return a + b; };
    SegmentTree<ll, ll>::Apply apply = [](ll a, ll x) { return x; };
    SegmentTree<ll, ll> segtree_min(N, N, op_min, apply);
    SegmentTree<ll, ll> segtree_max(N, -1, op_max, apply);
    SegmentTree<ll, ll> segtree_add(N, 0, op_add, apply);

    REP(j, 0, i) {
      ll pos = rank[j].second;
      segtree_min.update(pos, pos);
      segtree_max.update(pos, pos);
      // cerr << "  " << pos << " is insert" << endl;
    }

    ll cnt = 0, maxv;
    REP(j, i, N) {
      ll val = rank[j].first, pos = rank[j].second;
      ll l = segtree_max.query(0, pos) + 1;
      ll r = segtree_min.query(pos + 1, N);
      ll s = (r - l) - segtree_add.query(l, r);
      // cerr << "  range: " << r - l - 1 << endl;
      // cerr << "  sum: " << s << endl;
      if(r - l < K || s < K) {
        segtree_min.update(pos, pos);
        segtree_max.update(pos, pos);
        // cerr << "  " << pos << " is insert" << endl;
      } else {
        segtree_add.update(pos, 1);
        cnt++;
        if(cnt == Q) maxv = val;
      }
    }
    if(cnt >= Q) {
      // cerr << maxv << " - " << minv << " = " << maxv - minv << endl;
      ans = min(ans, maxv - minv);
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 384