#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
template <typename T>
class SegmentTree {
 public:
  using F = function<T(T, T)>;
  int n;
  vector<T> tree;
  const F operation;
  const T def;
  SegmentTree(int size, F _operation, T _def)
      : operation(_operation), def(_def) {
    n = 1;
    while (n < size) n *= 2;
    tree.resize(2 * n - 1, def);
  }
  void initialize(vector<T> v) {
    int vSize = v.size();
    n = 1;
    while (n < vSize) n *= 2;
    tree.resize(2 * n - 1, def);
    for (int i = 0; i < vSize; i++) tree[i + n - 1] = v[i];
    for (int i = n - 2; i >= 0; i--)
      tree[i] = operation(tree[2 * i + 1], tree[2 * i + 2]);
  }
  void update(int index, T value) {
    index += n - 1;
    tree[index] = value;
    while (index > 0) {
      index = (index - 1) / 2;
      tree[index] = operation(tree[2 * index + 1], tree[2 * index + 2]);
    }
  }
  T query(int a, int b, int k = 0, int l = 0, int r = -1) {
    if (r < 0) r = n;
    if (r <= a || b <= l)
      return def;
    else if (a <= l && r <= b)
      return tree[k];
    else {
      T lval = query(a, b, 2 * k + 1, l, (l + r) / 2);
      T rval = query(a, b, 2 * k + 2, (l + r) / 2, r);
      return operation(lval, rval);
    }
  }
};
int N, K, Q;
vector<long long> A;
int main() {
  cin >> N >> K >> Q;
  A.resize(N);
  for (int i = 0; i < (N); ++i) cin >> A[i];
  vector<pair<long long, int>> v;
  for (int i = 0; i < N; i++) v.push_back(make_pair(A[i], i));
  sort(A.begin(), A.end());
  set<int> se;
  se.insert(-1);
  se.insert(N);
  long long ans = MOD;
  for (int i = 0; i < N; i++) {
    int now = v[i].second;
    if (N - i - K + 1 < Q) break;
    SegmentTree<int> seg(
        N + 2, [](int a, int b) { return a + b; }, 0);
    int sum = 0;
    int last = 0;
    for (int j = i; j < N; j++) {
      if (sum >= Q) break;
      int tar = v[j].second;
      auto itr = se.lower_bound(tar);
      int r = *itr;
      itr--;
      int l = *itr;
      int used = seg.query(l + 1, r);
      int num = r - l - 1 - used;
      if (num >= K) {
        last = A[tar];
        sum++;
        seg.update(tar, 1);
      }
    }
    if (sum >= Q) ans = min(ans, last - A[now]);
    se.insert(now);
  }
  cout << ans << endl;
  return 0;
}
