#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const long long MOD = 1000000007;
const long long INF = 1e15;
int main() {
  long long N, K, Q;
  cin >> N >> K >> Q;
  vector<long long> A(N);
  vector<pair<long long, long long> > b(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    b[i] = pair<long long, long long>(A[i], i);
  }
  sort(A.begin(), A.end());
  sort(b.begin(), b.end());
  long long can = N - K + 1;
  long long ans = A[Q - 1] - A[0];
  set<long long> div;
  div.insert(-1);
  div.insert(N);
  for (long long rm = 0; rm + Q < N; rm++) {
    auto iter = div.lower_bound(b[rm].second);
    long long right = *iter;
    iter--;
    long long left = *iter;
    can = can - max(0LL, (right - left - K)) + max(0LL, (rm - left - K)) +
          max(0LL, (right - rm - K));
    if (can >= Q) ans = min(ans, A[Q + rm] - A[rm + 1]);
    div.insert(b[rm].second);
  }
  cout << ans << endl;
  return 0;
}
