#include <bits/stdc++.h>
using namespace std;
inline char nchar() {
  static const int bufl = 1 << 20;
  static char buf[bufl], *a = NULL, *b = NULL;
  return a == b && (b = (a = buf) + fread(buf, 1, bufl, stdin), a == b) ? EOF
                                                                        : *a++;
}
inline int read() {
  int x = 0, f = 1;
  char c = nchar();
  for (; !isdigit(c); c = nchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = nchar()) x = x * 10 + c - '0';
  return x * f;
}
template <typename T>
inline T &Min(T &x, const T &y) {
  return x > y ? (x = y) : x;
}
const int maxn = 2e3 + 10;
int n, k, q, a[maxn], ord[maxn];
int sid[maxn], cnt, size[maxn];
multiset<int> st[maxn];
inline bool cmp(int x, int y) { return a[x] < a[y]; }
int check(int x) {
  int val = a[ord[x]];
  cnt = 0;
  for (int i = 1; i <= n; ++i) size[i] = 0;
  for (int i = 1; i <= n; ++i) {
    if (a[i] < val)
      ++cnt;
    else
      sid[i] = cnt, ++size[cnt];
  }
  int now = x, lst;
  for (int i = 0; i < q; ++i, ++now) {
    while (now <= n && size[sid[ord[now]]] < k) ++now;
    if (now > n) return INT_MAX;
    int p = ord[now];
    lst = a[p];
    --size[sid[p]];
  }
  return lst - val;
}
int main() {
  n = read(), k = read(), q = read();
  for (int i = 1; i <= n; ++i) {
    a[i] = read();
    ord[i] = i;
  }
  sort(ord + 1, ord + n + 1, cmp);
  int ans = INT_MAX;
  for (int i = 1; i <= n - q + 1; ++i) {
    int tmp = check(i);
    Min(ans, tmp);
  }
  printf("%d\n", ans);
  return 0;
}
