#include <bits/stdc++.h>
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
typedef struct {
  int32_t a;
  int32_t b;
} hw;
typedef struct {
  int64_t a;
  int64_t b;
} hwll;
typedef struct {
  int64_t a;
  int64_t b;
  int64_t c;
} hwllc;
typedef struct {
  hwll a;
  hwll b;
} linell;
uint64_t n, m;
uint64_t h, w;
uint64_t k;
uint64_t q;
uint64_t vua, vub, vuc, vud, vue, vuf;
int64_t vsa, vsb, vsc, vsd, vse, vsf;
long double vra, vrb, vrc;
double vda, vdb, vdc;
size_t slen;
size_t tlen;
char ch, dh;
uint64_t umin(uint64_t x, uint64_t y) { return (x < y) ? x : y; }
uint64_t umax(uint64_t x, uint64_t y) { return (x > y) ? x : y; }
int64_t smin(int64_t x, int64_t y) { return (x < y) ? x : y; }
int64_t smax(int64_t x, int64_t y) { return (x > y) ? x : y; }
uint64_t gcd(uint64_t x, uint64_t y) {
  if (x < y) {
    return gcd(y, x);
  } else if (y == 0) {
    return x;
  } else {
    return gcd(y, x % y);
  }
}
uint64_t bitpow(uint64_t a, uint64_t x, uint64_t modulo) {
  uint64_t result = 1;
  while (x) {
    if (x & 1) {
      result *= a;
      result %= modulo;
    }
    x /= 2;
    a = (a * a) % modulo;
  }
  return result;
}
uint64_t divide(uint64_t a, uint64_t b, uint64_t modulo) {
  return (a * bitpow(b, modulo - 2, modulo)) % modulo;
}
uint64_t udiff(uint64_t a, uint64_t b) {
  if (a >= b) {
    return a - b;
  } else {
    return b - a;
  }
}
int64_t sdiff(int64_t a, int64_t b) {
  if (a >= b) {
    return a - b;
  } else {
    return b - a;
  }
}
void printUquotient(uint64_t left, uint64_t right) {
  const int32_t digits = 20;
  printf("%llu.", left / right);
  left %= right;
  for (int32_t i = 0; i < digits; i++) {
    left *= 10;
    printf("%1d", left / right);
    left %= right;
  }
  puts("");
  return;
}
void printSquotient(int64_t left, int64_t right) {
  if (left * right < 0) putchar('-');
  printUquotient(sdiff(left, 0), sdiff(right, 0));
  return;
}
int bitcount(uint64_t n) {
  int result = 0;
  while (n) {
    if (n & 1) result++;
    n /= 2;
  }
  return result;
}
int32_t pullcomp(const void *left, const void *right) {
  uint64_t l = *(uint64_t *)left;
  uint64_t r = *(uint64_t *)right;
  if (l < r) {
    return -1;
  }
  if (l > r) {
    return +1;
  }
  return 0;
}
int32_t psllcomp(const void *left, const void *right) {
  int64_t l = *(int64_t *)left;
  int64_t r = *(int64_t *)right;
  if (l < r) {
    return -1;
  }
  if (l > r) {
    return +1;
  }
  return 0;
}
int32_t pcharcomp(const void *left, const void *right) {
  char l = *(char *)left;
  char r = *(char *)right;
  if (l < r) {
    return -1;
  }
  if (l > r) {
    return +1;
  }
  return 0;
}
int32_t pstrcomp(const void *left, const void *right) {
  char *l = *(char **)left;
  char *r = *(char **)right;
  return strcmp(l, r);
}
int32_t phwllABcomp(const void *left, const void *right) {
  hwll l = *(hwll *)left;
  hwll r = *(hwll *)right;
  if (l.a < r.a) {
    return -1;
  }
  if (l.a > r.a) {
    return +1;
  }
  if (l.b < r.b) {
    return -1;
  }
  if (l.b > r.b) {
    return +1;
  }
  return 0;
}
int32_t ptriplecomp(const void *left, const void *right) {
  hwllc l = *(hwllc *)left;
  hwllc r = *(hwllc *)right;
  if (l.a < r.a) {
    return -1;
  }
  if (l.a > r.a) {
    return +1;
  }
  if (l.b < r.b) {
    return -1;
  }
  if (l.b > r.b) {
    return +1;
  }
  if (l.c < r.c) {
    return -1;
  }
  if (l.c > r.c) {
    return +1;
  }
  return 0;
}
bool isinrange(int64_t left, int64_t x, int64_t right) {
  return (left <= x && x <= right);
}
uint64_t parent[200000];
uint64_t rank[200000];
void uf_init(uint64_t n) {
  for (int64_t i = 0; i < n; i++) {
    parent[i] = i;
    rank[i] = 0;
  }
}
uint64_t uf_find(uint64_t x) {
  if (parent[x] == x) return x;
  return parent[x] = uf_find(parent[x]);
}
bool uf_union(uint64_t a, uint64_t b) {
  a = uf_find(a);
  b = uf_find(b);
  if (a == b) return false;
  if (rank[a] > rank[b]) {
    parent[b] = a;
  } else {
    parent[a] = b;
    if (rank[a] == rank[b]) {
      rank[b]++;
    }
  }
  return true;
}
int64_t a[200000];
int64_t b[200000];
char s[200000 + 1];
uint64_t alp[26];
uint64_t watched[200000];
bool func(uint64_t vmin, uint64_t vmax) {
  static uint64_t seed = 0;
  seed++;
  int64_t l = 0, r = 0;
  uint64_t counter = 0;
  uint64_t forgiven = 0;
  uint64_t selected = 0;
  while (r < n) {
    r++;
    counter++;
    if (a[r - 1] < vmin) {
      l = r;
      counter = 0;
      continue;
    }
    if (a[r - 1] <= vmax) forgiven++;
    if (counter == k) {
      if (forgiven) {
        selected++;
        forgiven--;
      } else {
        l++;
      }
      counter--;
    }
  }
  return (selected >= q);
}
uint64_t solve() {
  int64_t i, j, ki, li;
  int64_t result = 0;
  double dresult = 0;
  int64_t maybe = 0;
  int64_t sum = 0;
  int64_t item;
  uint64_t *dpcell;
  if (n == 1) {
    result = 0;
    goto success;
  }
  for (i = 0; i < n; i++) {
    b[i] = a[i];
  }
  qsort(b, n, sizeof(uint64_t), pullcomp);
  result = 200000000000007LL;
  for (i = 0; i + q <= n; i++) {
    int64_t ok = n, ng = i - 1;
    while (ng + 1 < ok) {
      int64_t med = (ok + ng) / 2;
      if (func(b[i], b[med])) {
        ok = med;
      } else {
        ng = med;
      }
    }
    result = umin(result, b[ok] - b[i]);
  }
  printf("%lld\n", result);
  return 0;
success:
  printf("%llu\n", result);
  return 0;
fail:
  puts("-1");
  return 1;
}
int32_t main(void) {
  int32_t i, j;
  int32_t x, y;
  scanf("%llu", &n, &m);
  scanf("%llu", &k, &n);
  scanf("%llu", &q);
  for (i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
  }
  solve();
  return 0;
}
