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