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