#include <bits/stdc++.h>
int n, k, q, ans = 0x7fffffff, tmi, tma;
int a[2000 + 5], p[2000 + 5];
bool e[2000 + 5], f = false;
bool cmp1(int x, int y) { return a[x] < a[y]; }
int main() {
  memset(e, true, sizeof(e));
  scanf("%d%d%d", &n, &k, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    p[i] = i;
  }
  std::sort(p + 1, p + 1 + n, cmp1);
  ans = a[p[q]] - a[p[1]];
  for (int i = 1; i <= n; i++) {
    for (int j = std::max(1, p[i] - k + 1); j <= std::min(n, p[i] + k - 1); j++)
      e[j] = false;
    for (int j = 1, c = 0; c < q && j <= n; j++) {
      if (e[p[j]]) {
        ++c;
        if (c == 1) tmi = a[p[j]];
        if (c == q) tma = a[p[j]];
      }
      if (j == n && c < q) f = true;
    }
    if (f) break;
    ans = std::min(ans, tma - tmi);
  }
  printf("%d\n", ans);
}
