#include <bits/stdc++.h>
using namespace std;
long long modulo(long long num) {
  return ((num % 1000000007) + 1000000007) % 1000000007;
}
long long power(long long b, long long e, long long MOD = 1000000007) {
  long long ans = 1;
  while (e) {
    if (e % 2) ans = (ans * b) % MOD;
    b = (b * b) % MOD;
    e /= 2;
  }
  return ans;
}
long long inv(long long num, long long MOD = 1000000007) {
  return power(modulo(num), 1000000007 - 2, MOD);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k, q, i, j;
  cin >> n >> k >> q;
  int a[n + 5];
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int ans = 1000000007;
  for (i = 0;; i++) {
    if ((i + q - 1) == (n - k + 1)) break;
    ans = min(a[i + q - 1] - a[i], ans);
  }
  cout << ans << endl;
  return 0;
}
