#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool upmin(T &x, T y) {
  return y < x ? x = y, 1 : 0;
}
template <typename T>
inline bool upmax(T &x, T y) {
  return x < y ? x = y, 1 : 0;
}
const long double eps = 1e-11;
const long double pi = acos(-1);
const int oo = 1 << 30;
const long long loo = 1ll << 62;
const int mods = 998244353;
const int MAXN = 200005;
const int INF = 0x3f3f3f3f;
inline int read() {
  int f = 1, x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + (c ^ 48);
    c = getchar();
  }
  return x * f;
}
int a[MAXN], b[MAXN], c[MAXN], ans = INF;
int main() {
  int n = read(), k = read(), m = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = 1; i <= n; i++) {
    int num = 0;
    for (int j = 1; j <= n; j++) b[j] = a[j];
    for (int j = 1, lst = 0; j <= n + 1; j++)
      if (a[j] < a[i]) {
        if (lst) {
          sort(b + lst + 1, b + j);
          for (int t = 1; t <= j - lst - k + 1; t++) c[++num] = b[t + lst - 1];
          lst = 0;
        }
      } else if (!lst)
        lst = j;
    if (num < m) continue;
    sort(c + 1, c + num + 1);
    upmin(ans, c[m] - c[1]);
  }
  printf("%d\n", ans);
  return 0;
}
