#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A;
  A.resize(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  sort(A.begin(), A.end());
  int min = 2000000000;
  for (int i = 0; i < N - Q + 1; i++) {
    if (A[i + Q - 1] - A[i] < min) min = A[i + Q - 1] - A[i];
  }
  cout << min << endl;
  return 0;
}
