#include <bits/stdc++.h>
using namespace std;
int A[2005];
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  for (int i = 0; i < n; i++) cin >> A[i];
  sort(A, A + n);
  int ans = 2e9;
  for (int i = 0; i < n - k - q + 2; i++) ans = min(ans, A[i + q - 1] - A[i]);
  cout << ans << endl;
  return 0;
}
