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