#include <bits/stdc++.h>
using namespace std;
const int inf = 2000 * 1000 * 1000;
const int N = 2005;
int ans, n, kk, qq, a[N], c[N], f[N], s[N];
pair<int, int> b[N];
void solve(int k) {
  int i, j;
  memset(f, 0, sizeof(f));
  memset(s, 0, sizeof(s));
  for (i = 1; i <= n; ++i) {
    if (i == 1 || !c[i - 1])
      f[i] = i, s[i] = 1;
    else
      f[i] = f[i - 1], s[f[i]]++;
  }
  int cnt = 0;
  int l = inf, r = 0;
  for (i = k; i <= n; ++i) {
    int p = b[i].second;
    if (s[f[p]] < kk) continue;
    ++cnt;
    l = min(l, b[i].first);
    r = max(r, b[i].first);
    if (cnt == qq) {
      ans = min(ans, r - l);
      break;
    }
    s[f[p]]--;
  }
}
int main() {
  int i, j;
  scanf("%d%d%d", &n, &kk, &qq);
  for (i = 1; i <= n; ++i) scanf("%d", a + i);
  for (i = 1; i <= n; ++i) b[i] = (pair<int, int>){a[i], i};
  sort(b + 1, b + 1 + n);
  ans = 2000 * 1000 * 1000;
  for (i = 1; i <= n; ++i) {
    if (i > 1 && b[i].first == b[i - 1].first) continue;
    for (j = 1; j <= n; ++j)
      if (a[j] < b[i].first)
        c[j] = 0;
      else
        c[j] = 1;
    solve(i);
  }
  printf("%d\n", ans);
  assert(ans != 2000 * 1000 * 1000);
  return 0;
}
