#include <bits/stdc++.h>
using namespace std;
namespace {
void Solve(int64_t) {
  int64_t n, k, q;
  if (not(cin >> n >> k >> q)) return;
  vector<int64_t> arr(n);
  for (auto &a : arr) cin >> a;
  auto vals = arr;
  sort(vals.begin(), vals.end());
  vals.erase(unique(vals.begin(), vals.end()), vals.end());
  auto is_poss = [&](int64_t low_val, int64_t hig_val) {
    int64_t cnt = 0;
    for (int64_t i = 0; i < n;) {
      if (arr[i] < low_val) {
        ++i;
        continue;
      }
      int64_t j = i;
      int64_t gray = 0, black = 0;
      while (j < n and arr[j] >= low_val) {
        if (arr[j] <= hig_val)
          ++gray;
        else
          ++black;
        ++j;
      }
      cnt += min(black + gray - k + 1, gray);
      i = j;
    }
    return cnt >= q;
  };
  int64_t low = 0, hig = 1e9;
  while (low <= hig) {
    const int64_t mid = (low + hig) / 2;
    bool can = false;
    for (int64_t i = 0, __i = n; i < __i; ++i) {
      int64_t j = i;
      while (j < n and vals[j] - vals[i] <= mid) ++j;
      if (i < j and is_poss(vals[i], vals[j - 1])) {
        can = true;
        break;
      }
    }
    if (can) {
      hig = mid - 1;
    } else {
      low = mid + 1;
    }
  }
  cout << (hig + 1) << endl;
}
void Init() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
}
}  // namespace
int32_t main() {
  Init();
  int64_t tests = 11;
  for (int64_t test = 1, __test = tests + 1; test < __test; ++test) Solve(test);
  return 0;
}
