#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 2007;
const long long INF = 2e9 + 7;
long long a[MAXN];
long long v[MAXN];
bool comp(long long i, long long j) { return a[i] < a[j]; }
long long tree[MAXN * 4];
long long sum[MAXN * 4];
void build(long long v, long long tl, long long tr) {
  if (tl == tr) {
    tree[v] = a[tl];
    sum[v] = 1;
    return;
  }
  long long tm = (tl + tr) / 2;
  build(v * 2 + 1, tl, tm);
  build(v * 2 + 2, tm + 1, tr);
  tree[v] = min(tree[v * 2 + 1], tree[v * 2 + 2]);
  sum[v] = sum[v * 2 + 1] + sum[v * 2 + 2];
}
void upd(long long v, long long tl, long long tr, long long p) {
  if (tl == tr) {
    tree[v] = INF;
    sum[v] = 0;
    return;
  }
  long long tm = (tl + tr) / 2;
  if (p <= tm)
    upd(v * 2 + 1, tl, tm, p);
  else
    upd(v * 2 + 2, tm + 1, tr, p);
  tree[v] = min(tree[v * 2 + 1], tree[v * 2 + 2]);
  sum[v] = sum[v * 2 + 1] + sum[v * 2 + 2];
}
long long getmin(long long v, long long tl, long long tr, long long l,
                 long long r) {
  if (tr < l || r < tl) return INF;
  if (l <= tl && tr <= r) return tree[v];
  long long tm = (tl + tr) / 2;
  return min(getmin(v * 2 + 1, tl, tm, l, r),
             getmin(v * 2 + 2, tm + 1, tr, l, r));
}
long long getsum(long long v, long long tl, long long tr, long long l,
                 long long r) {
  if (tr < l || r < tl) return 0;
  if (l <= tl && tr <= r) return sum[v];
  long long tm = (tl + tr) / 2;
  return getsum(v * 2 + 1, tl, tm, l, r) + getsum(v * 2 + 2, tm + 1, tr, l, r);
}
long long getl_(long long v, long long tl, long long tr, long long l,
                long long r, long long x) {
  if (tr < l || r < tl) return -1;
  if (x <= tree[v]) return -1;
  if (tl == tr) return tl;
  long long tm = (tl + tr) / 2;
  long long lres = getl_(v * 2 + 1, tl, tm, l, r, x);
  if (lres != -1)
    return lres;
  else
    return getl_(v * 2 + 2, tm + 1, tr, l, r, x);
}
long long getr_(long long v, long long tl, long long tr, long long l,
                long long r, long long x) {
  if (tr < l || r < tl) return -1;
  if (x <= tree[v]) return -1;
  if (tl == tr) return tl;
  long long tm = (tl + tr) / 2;
  long long rres = getr_(v * 2 + 2, tm + 1, tr, l, r, x);
  if (rres != -1)
    return rres;
  else
    return getr_(v * 2 + 1, tl, tm, l, r, x);
}
long long getl(long long i, long long x, long long n) {
  if (x <= getmin(0, 0, n - 1, 0, i))
    return -1;
  else
    return getl_(0, 0, n - 1, 0, i - 1, x);
}
long long getr(long long i, long long x, long long n) {
  if (x <= getmin(0, 0, n - 1, i, n - 1))
    return n;
  else
    return getr_(0, 0, n - 1, i, n - 1, x);
}
bool ch(long long i, long long x, long long n, long long k) {
  long long l = getl(i, x, n);
  long long r = getr(i, x, n);
  long long len = getsum(0, 0, n - 1, l + 1, r - 1);
  return k <= len;
}
bool check(long long l, long long r, long long n, long long k, long long q) {
  vector<long long> can;
  for (long long i = 0; i < n; ++i) {
    if (l <= a[i] && a[i] <= r) can.push_back(i);
  }
  sort(can.begin(), can.end(), comp);
  build(0, 0, n - 1);
  long long del = 0;
  for (long long i : can) {
    if (ch(i, a[i], n, k)) {
      ++del;
      upd(0, 0, n - 1, i);
    }
  }
  return q <= del;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, k, q;
  cin >> n >> k >> q;
  for (long long i = 0; i < n; ++i) cin >> a[i];
  set<long long> ms;
  for (long long i = 0; i < n; ++i) ms.insert(a[i]);
  long long p = 0;
  for (long long elem : ms) v[p++] = elem;
  long long ans = INF;
  long long u = -1;
  for (long long l = 0; l < p; ++l) {
    u = max(u, l);
    while (u < p && !check(v[l], v[u], n, k, q)) ++u;
    if (u == p) break;
    ans = min(ans, v[u] - v[l]);
  }
  cout << ans << '\n';
  return 0;
}
