#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, k, q, a[2005], rk[2005], r[2005], len[2005], ans;
bool cho[2005];
bool cmp(int x, int y) { return a[x] < a[y]; }
inline int solve(int x) {
  register int i, bl = 0;
  memset(r, 0, sizeof r);
  for (i = 1; i <= n; i++)
    if (!cho[i]) {
      if (cho[i - 1])
        len[++bl] = 1;
      else
        ++len[bl];
      r[i] = bl;
    }
  int cnt = 0, mn = 200000000, mx = -200000000;
  for (i = x; i <= n; i++) {
    if (len[r[rk[i]]] >= k)
      mn = min(mn, a[rk[i]]), mx = max(mx, a[rk[i]]), --len[r[rk[i]]], ++cnt;
    if (cnt == q) break;
  }
  return cnt == q ? mx - mn : 200000000;
}
int main() {
  n = read(), k = read(), q = read();
  register int i;
  for (i = 1; i <= n; i++) a[rk[i] = i] = read();
  sort(rk + 1, rk + n + 1, cmp);
  ans = 200000000;
  for (i = 0; i <= n; i++) {
    cho[rk[i]] = 1;
    ans = min(ans, solve(i + 1));
  }
  printf("%d\n", ans);
  return 0;
}
