#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define rev(i,s,e) for(i64 (i) = (s);(i) --> (e);)
#define all(x) x.begin(),x.end()

template<class T>
static inline std::vector<T> ndvec(size_t&& n, T val) noexcept {
  return std::vector<T>(n, std::forward<T>(val));
}

template<class... Tail>
static inline auto ndvec(size_t&& n, Tail&&... tail) noexcept {
  return std::vector<decltype(ndvec(std::forward<Tail>(tail)...))>(n, ndvec(std::forward<Tail>(tail)...));
}

int main() {
  i64 N, K, Q;
  cin >> N >> K >> Q;
  vector<i64> A(N);
  rep(i,0,N) cin >> A[i];
  vector<pair<i64, i64>> B;
  rep(i,0,N) {
    B.push_back({ A[i], i });
  }
  sort(all(B));

  map<i64, i64> mp;
  mp[0] = N;
  i64 cnt = mp[0] - K + 1;
  i64 MIN = 1e18;
  rep(i,0,N) {
    auto liter = mp.upper_bound(B[i].second);
    --liter;
    i64 li = liter->first;
    i64 c = liter->second;
    if(cnt >= Q && c >= K) {
      MIN = std::min(MIN, B[i + Q - 1].first - B[i].first);
    }
    if(c >= K) {
      cnt -= c - K + 1;
    }
    mp.erase(liter);
    i64 left = B[i].second - li;
    i64 right = c - (B[i].second - li + 1);
    if(left > 0) {
      mp[li] = left;
      if(left >= K) {
        cnt += left - K + 1;
      }
    }
    if(right > 0) {
      mp[B[i].second + 1] = right;
      if(right >= K) {
        cnt += right - K + 1;
      }
    }
  }

  cout << MIN << endl;
}
