#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
vector<long long> A;
long long N, K, Q;
bool ok(long long mn, long long mx) {
  long long c = 0;
  long long cc = 0;
  long long kk = 0;
  for (long long i = 0; i <= N; i++) {
    if (A[i] < mn) {
      cc += min(kk, c - K + 1);
      c = 0;
      kk = 0;
    } else {
      c++;
      if (A[i] > mx) {
      } else {
        kk++;
      }
    }
  }
  return cc >= Q;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N >> K >> Q;
  A.resize(N);
  long long res = (long long)1 << 60;
  for (long long i = 0; i < N; i++) {
    cin >> A[i];
  }
  A.push_back(-1);
  for (long long i = 0; i < N; i++) {
    long long mx = (long long)2000000001;
    long long mn = A[i] - 1;
    long long m;
    while (mx - mn > 1) {
      m = (mx + mn) / 2;
      if (ok(A[i], m)) {
        mx = m;
      } else {
        mn = m;
      }
    }
    res = min(mx - A[i], res);
  }
  cout << res << endl;
}
