#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N, K, Q;
  cin >> N >> K >> Q;
  vector<long long int> A(N);
  set<long long int> S;
  for (size_t i = 0; i < N; i++) {
    cin >> A[i];
    S.insert(A[i]);
  }
  vector<long long int> X;
  for (auto s : S) {
    X.push_back(s);
  }
  long long int ans = 1LL << 60;
  for (size_t i = 0; i < X.size(); i++) {
    long long int minj = i, maxj = X.size();
    while (minj + 1 < maxj) {
      long long int j = (minj + maxj) / 2;
      long long int minv = X[i], maxv = X[j];
      long long int count = 0;
      long long int countsum = 0;
      long long int countmaxv = 0;
      for (long long int k = 0; k < N; k++) {
        if (maxv < A[k]) {
          countmaxv++;
        }
        if (minv <= A[k]) {
          count++;
        } else {
          countsum += max(0LL, min(count - K + 1, count - countmaxv));
          if (countsum >= Q) {
            break;
          }
          count = 0;
          countmaxv = 0;
        }
      }
      countsum += max(0LL, min(count - K + 1, count - countmaxv));
      if (countsum < Q) {
        minj = j;
      } else {
        maxj = j;
      }
    }
    if (maxj + 1 < X.size()) {
      ans = min(ans, X[minj + 1] - X[i]);
    }
  }
  if (ans == 1LL << 60) {
    ans = 0;
  }
  cout << ans << endl;
}
