#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int N = 2333;
int n, k, q;
int a[N], id[N];
bool cmp(int x, int y) { return a[x] < a[y]; }
int lst[N], ed;
bool bd[N];
void solve(int l, int r) {
  if (r - l - 1 < k) return;
  static int tmp[N];
  for (int i = l; i <= r; ++i) tmp[i] = a[i];
  nth_element(tmp + l, tmp + r - k + 1, tmp + r + 1);
  for (int i = l; i <= r - k + 1; ++i) lst[++ed] = tmp[i];
}
int calc() {
  ed = 0;
  for (int i = 1, l = 1; i <= n + 1; ++i)
    if (bd[i]) {
      if (l <= i - 1) solve(l, i - 1);
      l = i + 1;
    }
  if (ed < q) return INF;
  nth_element(lst + 1, lst + q, lst + ed + 1);
  int mn = lst[1], mx = lst[1];
  for (int i = 2; i <= q; ++i) {
    mn = min(mn, lst[i]);
    mx = max(mn, lst[i]);
  }
  return mx - mn;
}
int main() {
  scanf("%d%d%d", &n, &k, &q);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  for (int i = 1; i <= n; ++i) id[i] = i;
  sort(id + 1, id + n + 1);
  bd[n + 1] = true;
  int ans = INF;
  for (int i = 1; i <= n; ++i) {
    ans = min(ans, calc());
    bd[id[i]] = true;
  }
  printf("%d", ans);
  return 0;
}
