#include <bits/stdc++.h>
using namespace std;
int n, k, q;
int a[520233];
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);
  int ans = 0x3f3f3f3f;
  for (int i = 1; i + q - 1 + k - 1 <= n; ++i)
    ans = min(ans, a[i + q - 1] - a[i]);
  printf("%d", ans);
  return 0;
}
