#include <bits/stdc++.h>
using namespace std;
const int N = 3000;
int n, k, q, a[N], p[N], ans = 1e9 + 100;
template <class T>
ostream& operator<<(ostream& out, vector<T> v) {
  out << v.size() << '\n';
  for (auto e : v) out << e << ' ';
  return out;
}
set<int> smalls;
int aib[N];
bool cmp(int i, int j) { return a[i] < a[j]; }
int lsb(int k) { return k & -k; }
int que(int pos) {
  int ans = 0;
  for (; pos > 0; pos -= lsb(pos)) ans += aib[pos];
  return ans;
}
int query(int left, int right) {
  if (left <= 1) return que(right);
  return que(right) - que(left - 1);
}
void upd(int pos, int val) {
  for (; pos < N; pos += lsb(pos)) aib[pos] += val;
}
bool canTake(int pos) {
  auto it2 = smalls.upper_bound(pos);
  auto it1 = it2;
  it1--;
  int nr = (*it2 - *it1 - 1) - query(*it1 + 1, *it2 - 1);
  if (nr >= k) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k >> q;
  for (int i = 1; i <= n; i++) cin >> a[i], p[i] = i;
  sort(p + 1, p + n + 1, cmp);
  smalls.insert(0);
  smalls.insert(n + 1);
  for (int i = 1; i <= n; i++) {
    int j, sz = 0;
    memset(aib, 0, sizeof aib);
    for (j = i; sz < q && j <= n; j++) {
      if (canTake(j)) {
        sz++;
        upd(j, 1);
        if (sz == q) break;
      }
    }
    smalls.insert(i);
    if (sz == q)
      ans = min(ans, a[p[j]] - a[p[i]]);
    else
      break;
  }
  cout << ans << '\n';
}
