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