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