#include <bits/stdc++.h>
using namespace std;
multiset<int> s;
multiset<int>::iterator it;
int n, m, k, a[50005], id[50005], sz[50005], ht[50005], c[50005][2], fa[50005],
    ans = 0x3f3f3f3f;
bool vis[50005];
int merge(int x, int y) {
  if ((!x) || (!y)) return x | y;
  if (a[x] > a[y]) swap(x, y);
  c[x][1] = merge(c[x][1], y);
  if (ht[c[x][0]] < ht[c[x][1]]) swap(c[x][0], c[x][1]);
  ht[x] = ht[c[x][1]] + 1;
  sz[x] = sz[c[x][0]] + sz[c[x][1]] + 1;
  return x;
}
int getfa(int x) { return fa[x] == x ? x : fa[x] = getfa(fa[x]); }
bool cmp(int x, int y) { return a[x] > a[y]; }
int main() {
  scanf("%d%d%d", &n, &m, &k);
  int x, y;
  for (int i = 1; i <= n; i++)
    scanf("%d", &a[i]), id[i] = fa[i] = i, sz[i] = 1, ht[i] = 0;
  sort(id + 1, id + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    vis[id[i]] = 1;
    if (vis[id[i] - 1]) {
      x = getfa(id[i] - 1), y = getfa(id[i]);
      if (a[x] > a[y] && sz[y]) swap(x, y);
      if (sz[y]) fa[y] = x;
      merge(x, y);
    }
    if (vis[id[i] + 1]) {
      x = getfa(id[i] + 1), y = getfa(id[i]);
      if (a[x] > a[y] && sz[y]) swap(x, y);
      if (sz[y]) fa[y] = x;
      merge(x, y);
    }
    int tmp = getfa(id[i]);
    while (sz[tmp] >= m)
      s.insert(a[tmp]), x = merge(c[tmp][0], c[tmp][1]),
                        fa[tmp] = fa[x] = tmp = x;
    while (s.size() > k) it = s.end(), --it, s.erase(it);
    if (s.size() == k) it = s.end(), --it, ans = min(ans, (*it) - a[id[i]]);
  }
  printf("%d\n", ans);
}
