#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int n, ki, qi, ai[500000], bi[500000], ans, li[500000], ri[500000];
deque<int> dq;
inline int readin() {
  int x = 0, s = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') s = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * s;
}
int solve() {
  int ansi = 0, i, p, q;
  while (!dq.empty()) dq.pop_back();
  for (i = 1, p = ri[0]; i <= ki; ++i, p = ri[p]) {
    while (!dq.empty() && bi[dq.back()] > bi[p]) dq.pop_back();
    dq.push_back(p);
  }
  if (!dq.empty()) ansi = dq.front();
  for (q = ri[0], p = ri[p]; p != n + 1; p = ri[p], q = ri[q]) {
    if (!dq.empty() && dq.front() == q) dq.pop_front();
    while (!dq.empty() && bi[dq.back()] > bi[p]) dq.pop_back();
    if (!dq.empty() && bi[ansi] < bi[dq.front()]) ansi = dq.front();
  }
  return ansi;
}
int main() {
  int mx = 0, mn = INF, tmp;
  n = readin();
  ki = readin();
  qi = readin();
  ri[0] = 1;
  li[n + 1] = n;
  bi[0] = INF;
  for (int i = 1; i <= n; ++i) {
    bi[i] = ai[i] = readin();
    li[i] = i - 1;
    ri[i] = i + 1;
  }
  sort(ai + 1, ai + n + 1);
  ans = ai[qi] - ai[1];
  for (int i = 1; i <= qi; ++i) {
    tmp = solve();
    mx = max(mx, bi[tmp]);
    mn = min(mn, bi[tmp]);
    ri[li[tmp]] = ri[tmp];
    li[ri[tmp]] = li[tmp];
  }
  ans = min(ans, mx - mn);
  cout << ans << endl;
  return 0;
}
