#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int maxn = 2e3 + 5;
int n, k, q;
int a[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> k >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int ans = 1e9 + 9;
  for (int i = n - k; i - q + 1 >= 0; i--) {
    ans = min(ans, a[i] - a[i - q + 1]);
  }
  cout << ans << '\n';
}
