#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t N, K, Q;
  cin >> N >> K >> Q;
  vector<int64_t> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  set<int64_t> can_unuse;
  for (int i = 0; i < N; i++) {
    int left = i;
    int right = N - i - 1;
    if (left > right) {
      swap(left, right);
    }
    int remain_right = right - (Q - (left - K));
    if (remain_right >= K) {
      can_unuse.insert(A[i]);
    }
  }
  auto B = A;
  sort(B.begin(), B.end());
  int64_t ans = B[Q - 1] - B[0];
  for (int i = 0; i < N - Q; i++) {
    auto itr = can_unuse.find(B[i]);
    if (itr != can_unuse.end()) {
      ans = min(ans, B[Q - 1 + i + 1] - B[i + 1]);
    }
  }
  cout << ans << endl;
}
