#include <bits/stdc++.h>
using namespace std;
const int N = 2001;
int n, k, q, a[N], ans = 1e9;
int main() {
  scanf("%d%d%d", &n, &k, &q);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  sort(a, a + n);
  for (int i = 0; i + q - 1 < n; i++) {
    if (n - i - q + 1 < k) break;
    ans = min(ans, a[i + q - 1] - a[i]);
  }
  printf("%d\n", ans);
}
