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