#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("avx")
using namespace std;
const int cm = 1 << 15;
char cn[cm], *ci = cn, ct;
inline int getint() {
  int A = 0;
  while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
  return A;
}
const int K = 12;
const int KM = 1 << (K - 1);
long long dat[1 << K];
void update(int A) {
  dat[A] = min(dat[A * 2], dat[A * 2 + 1]);
  if (A != 1) update(A >> 1);
}
void add(int A, long long B) {
  int C = A + KM;
  dat[C] = B;
  update(C >> 1);
}
long long check(int L, int R, int A, int l, int r) {
  if (L <= l && r <= R) return dat[A];
  if (r <= L || R <= l) return 1ll << 60;
  return min(check(L, R, A * 2, l, (l + r) >> 1),
             check(L, R, A * 2 + 1, (l + r) >> 1, r));
}
long long query(int L, int R) { return check(L, R, 1, 0, KM); }
int main() {
  fread_unlocked(cn, 1, cm, stdin);
  int N = getint(), K = getint(), Q = getint();
  long long A[2002];
  int LR[2002];
  for (int i = 0; i < (1 << K); i++) dat[i] = 1ll << 60;
  for (int i = 1; i <= (N); i++) {
    A[i] = ((long long)getint() << 11) + i;
    add(i, A[i]);
  }
  for (int i = 0; i < (N + 2); i++) LR[i] = -1;
  priority_queue<int> q;
  int kotae = 1e9;
  int saishou = 2e9;
  sort(A + 1, A + N + 1);
  const int m = (1 << 11) - 1;
  for (int i = N; i >= 1; i--) {
    int a = A[i] >> 11;
    int k = A[i] & m;
    int l = (LR[k - 1] == -1) ? k : LR[k - 1];
    int r = (LR[k + 1] == -1) ? k : LR[k + 1];
    LR[l] = r;
    LR[r] = l;
    int kosuu = min(K - 1, r - k) + min(K - 1, k - l) + 1;
    int abureta = max(0, kosuu - K + 1);
    for (int i = 0; i < (abureta); i++) {
      long long tmp = query(l, r + 1);
      q.push(tmp >> 11);
      if ((tmp & m) >= KM) printf("wakaranai");
      add(tmp & m, 1ll << 60);
    }
    while (q.size() >= Q) {
      int tmp = q.top();
      saishou = min(saishou, tmp);
      q.pop();
    }
    kotae = min(kotae, saishou - a);
  }
  printf("%d", kotae);
  return 0;
}
