#include <bits/stdc++.h>
using namespace std;
int n, m, k, ans = 2e9, b[2005], a[2005];
bool f[2005];
inline int read() {
  int x = 0;
  char ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = (x << 3) + (x << 1) + ch - 48, ch = getchar();
  return x;
}
void work(int x) {
  b[0] = 0;
  memset(f, 0, sizeof(f));
  for (int i = 1, lt = 1; i <= n; ++i)
    if (a[i] < x) {
      int l = max(lt, i - m + 1), r = min(n, i + m - 1);
      for (int j = l; j <= r; ++j) f[j] = 1;
      lt = r + 1;
    }
  for (int i = 1; i <= n; ++i)
    if (!f[i]) b[++b[0]] = a[i];
  sort(b + 1, b + 1 + b[0]);
  if (b[0] >= k) ans = min(ans, b[k] - b[1]);
}
int main() {
  n = read(), m = read(), k = read();
  for (int i = 1; i <= n; ++i) a[i] = read();
  for (int i = 1; i <= n; ++i) work(a[i]);
  printf("%d\n", ans);
  return 0;
}
