#include <bits/stdc++.h>
using namespace std;
struct segment_tree {
  const long INF = 2 * 1e9;
  long n = 1;
  long data[10000];
  segment_tree(int a) {
    while (n < a) n *= 2;
    for (int i = 0; i < 2 * n; i++) data[i] = INF;
  }
  long nreturn() { return n; }
  void change(long k, long a) {
    k += n - 1;
    data[k] = a;
    while (k > 0) {
      k = (k - 1) / 2;
      data[k] = min(data[2 * k + 1], data[2 * k + 2]);
    }
    return;
  }
  long rmq(long a, long b, long k, long l, long r) {
    if (a >= r || b <= l) return INF;
    if (a <= l && b >= r) return data[k];
    long teml = rmq(a, b, 2 * k + 1, l, (l + r) / 2);
    long temr = rmq(a, b, 2 * k + 2, (l + r) / 2, r);
    return min(teml, temr);
  }
  long tmp(long a, long k) {
    if (n - 1 <= k) return k - n + 1;
    if (data[2 * k + 1] == a) return tmp(a, 2 * k + 1);
    return tmp(a, 2 * k + 2);
  }
};
int main() {
  int nn, k, q;
  cin >> nn >> k >> q;
  segment_tree tree(nn);
  int n = tree.nreturn();
  long a[nn];
  vector<long> vec;
  for (int i = 0; i < nn; i++) {
    cin >> a[i];
    tree.change(i, a[i]);
    vec.push_back(a[i]);
  }
  sort(vec.begin(), vec.end());
  long tem;
  long ans = 2 * 1e9;
  set<long> st;
  for (int i = 0; i < nn - q + 1; i++) {
    for (int j = k - 1; j >= 0; j--) {
      if (tree.data[j + n - 1] < vec[i]) {
        for (int k = 0; k <= j; k++) {
          tree.change(k, tree.INF);
        }
        break;
      }
    }
    for (int j = nn - k; j < nn; j++) {
      if (tree.data[j + n - 1] < vec[i]) {
        for (int k = j; k < nn; k++) {
          tree.change(k, tree.INF);
        }
        break;
      }
    }
    for (int j = 0; j < q; j++) {
      tem = tree.rmq(0, n, 0, 0, n);
      st.insert(tem);
      tree.change(tree.tmp(tem, 0), tree.INF);
    }
    auto itr = st.end();
    itr--;
    ans = min(ans, *itr - *st.begin());
    for (int j = 0; j < nn; j++) {
      tree.change(j, a[j]);
    }
    st = {};
  }
  cout << ans << endl;
}
