#include <bits/stdc++.h>
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using datas = pair<ll, ll>;
using ddatas = pair<long double, long double>;
using tdata = pair<ll, datas>;
using vec = vector<ll>;
using mat = vector<vec>;
using pvec = vector<datas>;
using pmat = vector<pvec>;
const ll mod = 1000000007;
const ll inf = 1LL << 60;
const long double PI = acos(-1);
const long double eps = 1e-9;
template <class T>
inline bool chmax(T& a, T b) {
  bool x = a < b;
  if (x) a = b;
  return x;
}
template <class T>
inline bool chmin(T& a, T b) {
  bool x = a > b;
  if (x) a = b;
  return x;
}
void startupcpp() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
int main() {
  startupcpp();
  int i, j, N, K, Q, ans;
  cin >> N >> K >> Q;
  vector<int> v(N), a(N);
  for (i = 0; i < (ll)N; ++i) {
    cin >> v[i];
    a[i] = v[i];
  }
  sort((v).begin(), (v).end());
  ans = v[Q - 1] - v[0];
  v.erase(unique((v).begin(), (v).end()), v.end());
  for (j = 1; j < (ll)v.size(); ++j) {
    int ok = v.size(), ng = j - 1, mid;
    while (ok - ng > 1) {
      int bf = -1, cnt = 0, res = 0;
      mid = (ok + ng) >> 1;
      for (i = 0; i < (ll)N; ++i) {
        if (a[i] < v[j]) {
          res += max(min(cnt, i - bf - K), 0);
          bf = i;
        } else if (a[i] <= v[mid]) {
          ++cnt;
        }
      }
      res += max(min(cnt, i - bf - K), 0);
      if (res >= Q) {
        ok = mid;
      } else {
        ng = mid;
      }
    }
    if (ok == (int)v.size()) break;
    chmin(ans, v[ok] - v[j]);
  }
  cout << ans << "\n";
}
