#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000, inf = 1e9;
int n, k, q;
int a[maxn];
int val[maxn], cntv;
bool Solve(int l, int r) {
  int cnt0 = 0, cnt1 = 0, cntop = 0;
  for (int i = 0; i <= n; ++i) {
    if (i == n || a[i] < l) {
      cntop += min(cnt0 + cnt1 - k + 1, cnt0);
      cnt0 = cnt1 = 0;
    } else if (a[i] <= r) {
      ++cnt0;
    } else {
      ++cnt1;
    }
  }
  return cntop >= q;
}
int main(void) {
  scanf("%d%d%d", &n, &k, &q);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
  }
  copy(a, a + n, val);
  sort(val, val + n);
  cntv = unique(val, val + n) - val;
  int ans = inf;
  for (int i = 0, j = 0; i < cntv; ++i) {
    while (j + 1 < cntv && !Solve(val[i], val[j])) {
      ++j;
    }
    if (j == cntv - 1 && !Solve(val[i], val[j])) {
      break;
    }
    ans = min(ans, val[j] - val[i]);
  }
  printf("%d\n", ans);
  return 0;
}
