#include <bits/stdc++.h>
using namespace std;
inline void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
inline void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
inline void Yay(bool b) { cout << (b ? "Yay!" : ":(") << endl; }
template <typename Monoid>
struct SegmentTree {
  using F = function<Monoid(Monoid, Monoid)>;
  int sz;
  vector<Monoid> seg;
  const F f;
  const Monoid M1;
  SegmentTree(int n, const F f, const Monoid &M1) : f(f), M1(M1) {
    sz = 1;
    while (sz < n) sz <<= 1;
    seg.assign(2 * sz, M1);
  }
  void set(int k, const Monoid &x) { seg[k + sz] = x; }
  void build() {
    for (int k = sz - 1; k > 0; --k) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }
  void update(int k, const Monoid &x) {
    k += sz;
    seg[k] = x;
    while (k >>= 1) seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
  }
  Monoid query(int a, int b) {
    Monoid L = M1, R = M1;
    for (a += sz, b += sz; a < b; a >>= 1, b >>= 1) {
      if (a & 1) L = f(L, seg[a++]);
      if (b & 1) R = f(seg[--b], R);
    }
    return f(L, R);
  }
  Monoid operator[](const int &k) const { return seg[k + sz]; }
};
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(15);
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> v(N);
  SegmentTree<int> minseg(
      N, [](int a, int b) { return min(a, b); }, INT_MAX);
  for (int i = 0, i_max = (N); i < i_max; ++i) {
    cin >> v[i];
    minseg.set(i, v[i]);
  }
  minseg.build();
  vector<int> w(N);
  for (int i = 0, i_max = (N); i < i_max; ++i) {
    w[i] = v[i];
    int s = i + 1, e = i;
    int count = 0;
    while (count < K) {
      --s;
      if (v[s] >= v[i]) ++count;
      if (s == 0) break;
    }
    while (count < K) {
      ++e;
      if (v[e] >= v[i]) ++count;
      if (e == N - 1) break;
    }
    if (count < K) {
      w[i] = -1;
      continue;
    }
    int m = -1;
    while (s <= i && e < N) {
      m = max(m, minseg.query(s, e));
      while (v[++s] < v[i])
        ;
      while (v[++e] < v[i])
        if (e == N) break;
    }
    w[i] = min(w[i], m);
  }
  int ans = INT_MAX;
  for (int i = 0, i_max = (N); i < i_max; ++i) {
    if (w[i] == -1) continue;
    vector<int> del;
    for (int j = 0, j_max = (N); j < j_max; ++j) {
      if (v[j] < v[i] || w[j] < v[i]) continue;
      del.push_back(v[j]);
    }
    if (del.size() < Q) continue;
    sort((del).begin(), (del).end());
    ans = min(ans, del[Q - 1] - v[i]);
  }
  cout << ans << endl;
  return 0;
}
