#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  std::vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  int han = 0;
  if (n - k - q + 1 <= k + q - 2) han = 1;
  if (han) {
    std::vector<int> s(2 * k + 2 * q - n - 2);
    for (int i = 0; i + n - k - q + 1 < k + q - 1; i++) {
      s[i] = v[i + n - k - q + 1];
    }
    sort(s.begin(), s.end());
    sort(v.begin(), v.end());
    int ans = 1000000000;
    for (int i = 0; i + q - 1 < n; i++)
      if (v[i] <= s[0] && s[0] <= v[i + q - 1])
        ans = min(ans, v[i + q - 1] - v[i]);
    cout << ans << endl;
  } else {
    sort(v.begin(), v.end());
    int ans = v[q - 1] - v[0];
    for (int i = 0; i + q - 1 < n; i++) ans = min(ans, v[i + q - 1] - v[i]);
    cout << ans << endl;
  }
}
