#include <bits/stdc++.h>
using namespace std;
int a[262144], b[262144], c[262144], h[262144], k, m, n, p[262144], q[262144],
    x, z;
bool w[262144];
inline void up(int u) {
  p[u] = max(p[u << 1], p[u << 1 | 1]), q[u] = q[u << 1] + q[u << 1 | 1],
  w[u] = w[u << 1] & w[u << 1 | 1];
}
inline void Del(int u) {
  for (u |= m; u; u >>= 1) h[u]--;
}
inline void del(int u) {
  Del(c[u]), u |= m, p[u] = q[u] = 0, w[u] = false;
  while (u >>= 1) up(u);
}
inline int left(int u) {
  for (u |= m; u > 1; u >>= 1)
    if ((u & 1) && !w[u ^ 1]) {
      u ^= 1;
      while (u < m) !w[u << 1 | 1] ? u = u << 1 | 1 : u <<= 1;
      return u ^ m;
    }
  return 0;
}
inline int right(int u) {
  for (u |= m; u > 1; u >>= 1)
    if ((~u & 1) && !w[u ^ 1]) {
      u ^= 1;
      while (u < m) !w[u << 1] ? u <<= 1 : u = u << 1 | 1;
      return u ^ m;
    }
  return n + 1;
}
inline int sum(int u, int v) {
  int w = 0;
  for (u |= m, v |= m; u ^ v ^ 1; u >>= 1, v >>= 1) {
    if (~u & 1) w += q[u ^ 1];
    if (v & 1) w += q[v ^ 1];
  }
  return w;
}
inline int Max(int u, int v) {
  int w = 0;
  for (u |= m, v |= m; u ^ v ^ 1; u >>= 1, v >>= 1) {
    if ((~u & 1) && p[u ^ 1] > p[w]) w = u ^ 1;
    if ((v & 1) && p[v ^ 1] > p[w]) w = v ^ 1;
  }
  while (w < m) w = p[w << 1] <= p[w << 1 | 1] ? w << 1 | 1 : w << 1;
  return w ^ m;
}
inline int find(int w) {
  int u = 1;
  while (u < m) u = w > h[u << 1] ? w -= h[u << 1], u << 1 | 1 : u << 1;
  return u ^ m;
}
inline bool cmp(int u, int v) { return a[u] < a[v]; }
int main() {
  scanf("%d%d%d", &n, &k, &z), m = 1;
  while (m < n + 2) m <<= 1;
  for (int i = 1; i <= n; i++) scanf("%d", a + i), b[i] = i;
  sort(b + 1, b + n + 1, cmp), x = 0x7fffffff;
  for (int i = 1; i <= n; i++)
    c[b[i]] = i, p[m | i] = a[i], q[m | i] = 1, h[m | i] = 1, w[m | i] = true;
  for (int i = m - 1; i; i--) h[i] = h[i << 1] + h[i << 1 | 1], up(i);
  for (int i = 1, u, v; h[1] >= z; i++)
    if (h[m | i]) {
      x = min(x, a[b[find(z)]] - a[b[i]]);
      del(b[i]), u = left(b[i]), v = sum(u, b[i]);
      while (v && v > b[i] - u - k) v--, del(Max(u, b[i]));
      u = right(b[i]), v = sum(b[i], u);
      while (v && v > u - b[i] - k) v--, del(Max(b[i], u));
    }
  printf("%d\n", x);
  return 0;
}
