#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &A) {
  for (long long i = 0; i < A.size(); i++) os << A[i] << " ";
  os << endl;
  return os;
}
template <>
ostream &operator<<(ostream &os, const vector<vector<long long> > &A) {
  long long N = A.size();
  long long M;
  if (N > 0) M = A[0].size();
  for (long long i = 0; i < N; i++) {
    for (long long j = 0; j < M; j++) os << A[i][j] << " ";
    os << endl;
  }
  return os;
}
struct edge {
  long long from, to, d, c;
  edge(long long _from = 0, long long _to = 0, long long _d = 0,
       long long _c = 0) {
    from = _from;
    to = _to;
    d = _d;
    c = _c;
  }
  bool operator<(const edge &rhs) const {
    return (d == rhs.d) ? (c < rhs.c) : (d < rhs.d);
  }
};
struct aabb {
  long long x1, y1, x2, y2;
  aabb(long long x1, long long y1, long long x2, long long y2)
      : x1(x1), y1(y1), x2(x2), y2(y2) {}
};
struct flow {
  long long to, cap, rev, cost;
  flow(long long to = 0, long long cap = 0, long long rev = 0,
       long long cost = 0)
      : to(to), cap(cap), rev(rev), cost(cost) {}
};
const long long di[4] = {0, -1, 0, 1};
const long long dj[4] = {-1, 0, 1, 0};
const long long ci[5] = {0, 0, -1, 0, 1};
const long long cj[5] = {0, -1, 0, 1, 0};
const long long LINF = LLONG_MAX / 2;
const long long INF = INT_MAX / 2;
const double PI = acos(-1);
long long pow2(long long n) { return 1 << n; }
template <typename T, typename U>
bool chmin(T &x, const U &y) {
  if (x > y) {
    x = y;
    return true;
  }
  return false;
}
template <typename T, typename U>
bool chmax(T &x, const U &y) {
  if (x < y) {
    x = y;
    return true;
  }
  return false;
}
struct initializer {
  initializer() { cout << fixed << setprecision(11); }
};
initializer _____;
long long N, M, K, T, Q;
signed main() {
  cin >> N >> K >> Q;
  vector<long long> A(N);
  for (long long i = 0; i < (long long)(N); i++) cin >> A[i];
  priority_queue<pair<long long, long long>,
                 vector<pair<long long, long long> >,
                 greater<pair<long long, long long> > >
      q;
  for (long long i = 0; i < (long long)(N); i++)
    q.push(pair<long long, long long>(A[i], i));
  vector<bool> done(N + 1, false);
  done[N] = true;
  long long ans = LINF;
  while (1) {
    priority_queue<long long, vector<long long>, greater<long long> > q3;
    priority_queue<long long, vector<long long>, greater<long long> > q2;
    for (long long i = 0; i < (long long)(N + 1); i++) {
      if (done[i]) {
        while (q2.size() >= K) {
          q3.push(q2.top());
          q2.pop();
        }
      } else {
        q2.push(A[i]);
      }
    }
    long long tmp = 0;
    long long mina = LINF, maxa = 0;
    while (tmp < Q && !q3.empty()) {
      long long a = q3.top();
      q3.pop();
      chmin(mina, a);
      chmax(maxa, a);
      ++tmp;
    }
    if (tmp < Q) break;
    chmin(ans, maxa - mina);
    if (q.empty()) break;
    long long index = q.top().second;
    done[index] = true;
    q.pop();
  }
  cout << ans << endl;
  return 0;
}
