#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  int a[n];
  vector<int> v;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    v.push_back(a[i]);
  }
  sort(v.begin(), v.end());
  int ans = 1e9;
  for (int i = 0; i < n - q - 1; i++) {
    ans = min(ans, v[i + q - 1] - v[i]);
    break;
  }
  cout << ans << endl;
}
