#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
const long long int INF = 1000000010;
const long long int LINF = 4000000000000000010LL;
const int MAX = 310;
const double EPS = 1e-9;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int a[2010];
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int ans = INF;
  for (int i = 0; i <= n - q + 1 - k; i++) {
    ans = min(a[i + q - 1] - a[i], ans);
  }
  cout << ans << endl;
  return 0;
}
