#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e9;
const long long IINF = 1e18;
const double EPS = 1e-8;
const double pi = acos(-1);
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
struct BinaryIndexedTree {
 private:
  vector<int> dat;

 public:
  BinaryIndexedTree(int n_) { dat.resize(++n_, 0); }
  void add(int a, int w) {
    for (int i = a; i <= dat.size(); i += i & -i) dat[i] += w;
  }
  int sum(int a) {
    int res = 0;
    for (int i = a; i > 0; i -= i & -i) res += dat[i];
    return res;
  }
  int binarysearch(int w) {
    if (w <= 0) return 0;
    int x = 0;
    int n = 1;
    while (n * 2 <= dat.size()) n *= 2;
    for (int k = n; k > 0; k /= 2) {
      if (x + k <= n && dat[x + k] < w) {
        w -= dat[x + k];
        x += k;
      }
    }
    return x;
  }
};
int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<long long> A(N), compress(N);
  for (long long i = 0; i < N; ++i) {
    cin >> A[i];
    compress[i] = A[i];
  }
  sort(compress.begin(), compress.end());
  compress.erase(unique(compress.begin(), compress.end()), compress.end());
  for (long long i = 0; i < N; ++i)
    A[i] = lower_bound(compress.begin(), compress.end(), A[i]) -
           compress.begin() + 1;
  vector<pair<long long, long long> > B(N);
  for (long long i = 0; i < N; ++i) B[i] = pair<long long, long long>(A[i], i);
  sort(B.begin(), B.end());
  int s = compress.size();
  BinaryIndexedTree BIT(++s);
  for (long long i = 0; i < N; ++i) BIT.add(A[i], 1);
  vector<int> notmin(N, 0);
  long long ans = INF, rest = N;
  for (int i = 0; rest >= Q; ++i) {
    int sup = BIT.binarysearch(Q + 1);
    int center = B[i].second;
    if (notmin[center]) continue;
    chmin(ans, compress[sup - 1] - compress[i]);
    for (long long j = 0; j < K; ++j) {
      if (center + j < N && chmax(notmin[center + j], 1))
        BIT.add(A[center + j], -1), --rest;
      if (center - j >= 0 && chmax(notmin[center - j], 1))
        BIT.add(A[center - j], -1), --rest;
    }
  }
  cout << ans << endl;
}
