#include <bits/stdc++.h>
template <typename Tp>
void in(Tp &x) {
  char ch = getchar(), f = 1;
  x = 0;
  while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();
  if (ch == '-') ch = getchar(), f = -1;
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
template <typename Tp>
void out(Tp x) {
  if (x > 9) out(x / 10);
  putchar(x % 10 + '0');
  return;
}
template <typename Tp>
Tp Max(const Tp &x, const Tp &y) {
  return x > y ? x : y;
}
template <typename Tp>
Tp Min(const Tp &x, const Tp &y) {
  return x < y ? x : y;
}
template <typename Tp>
bool chkmax(Tp &x, Tp y) {
  return x >= y ? 0 : (x = y, 1);
}
template <typename Tp>
bool chkmin(Tp &x, Tp y) {
  return x <= y ? 0 : (x = y, 1);
}
const int MAXN = 2010;
int n, k, q, B[MAXN], A[MAXN], D[MAXN], C[MAXN], ans = 0x3f3f3f3f;
void solve(int x) {
  D[0] = 0;
  for (int i = 1, j; i <= n; i = j + 1) {
    j = i;
    if (A[i] < x) continue;
    while (j < n && A[j + 1] >= x) j++;
    C[0] = 0;
    for (int l = (i), l_END_ = (j); l <= l_END_; l++) C[++C[0]] = A[l];
    if (C[0] < k) continue;
    std::sort(C + 1, C + C[0] + 1);
    for (int l = (1), l_END_ = (C[0] - k + 1); l <= l_END_; l++)
      D[++D[0]] = C[l];
  }
  if (D[0] < q) return;
  std::sort(D + 1, D + q + 1);
  chkmin(ans, D[q] - D[1]);
}
int main() {
  in(n);
  in(k);
  in(q);
  for (int i = (1), i_END_ = (n); i <= i_END_; i++) in(A[i]), B[i] = A[i];
  std::sort(B + 1, B + n + 1);
  for (int i = (1), i_END_ = (n); i <= i_END_; i++) solve(B[i]);
  printf("%d\n", ans);
  return 0;
}
