#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const double PI = 3.14159265359;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k, q;
  cin >> n >> k >> q;
  vector<long long> v(n);
  for (auto& i : v) cin >> i;
  sort(v.begin(), v.end());
  long long ans = MOD;
  for (int i = 0; i + q < n; i++) {
    ans = min(ans, v[i + q - 1] - v[i]);
  }
  cout << ans;
  return 0;
}
