#include <bits/stdc++.h>
using namespace std;
long long check(int N, int K, int Q, long long* A) {}
int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  long long A[N];
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  long long B[N];
  for (int i = 0; i < N; i++) {
    B[i] = A[i];
  }
  sort(B, B + N);
  long long ans = B[Q - 1] - B[0];
  int min_index;
  for (int i = 0; i < N; i++) {
    if (A[i] == B[0]) {
      min_index = i;
      break;
    }
  }
  int hidari = min_index - K + 1;
  int migi = N - min_index - 1 - K + 1;
  if (hidari >= 0 && migi >= 0 && hidari + migi >= Q) {
    long long C[hidari + migi];
    sort(A, A + min_index);
    sort(A + min_index, A + N);
    for (int i = 0; i < hidari; i++) {
      C[i] = A[i];
    }
    for (int i = 0; i < migi; i++) {
      C[hidari + i] = A[min_index + i + 1];
    }
    sort(C, C + hidari + migi);
    ans = min(ans, C[Q - 1] - C[0]);
  }
  cout << ans << endl;
  return 0;
}
