#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
int a[10001], b[10001], c[10001], tot;
int n, k, q, ans = inf;
inline void find(int l, int r) {
  for (int i = l; i <= r; i++) b[i] = a[i];
  sort(b + l, b + l + r);
  for (int i = l; i <= r - k + 1; i++) c[++tot] = b[i];
}
inline void solve(int x) {
  int cut = 1;
  tot = 0;
  a[n + 1] = -inf;
  for (int i = 1; i <= n; i++) {
    if (a[i] < x) {
      if (i - 1 >= cut) find(cut, i - 1);
      cut = i + 1;
    }
  }
  if (cut <= n) find(cut, n);
  sort(c + 1, c + tot + 1);
  if (tot < q) return;
  ans = ((ans) < (c[q] - c[1]) ? (ans) : (c[q] - c[1]));
}
int main() {
  cin >> n >> k >> q;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) solve(a[i]);
  cout << ans;
}
