#include <bits/stdc++.h>
using namespace std;
const int N = 2010;
const int INF = 1e9;
int _w;
int n, k, q, a[N], r[N], ban[N];
bool cmp(int i, int j) { return a[i] < a[j]; }
int tmp[N], tn, t2[N];
void ins(int L, int R) {
  if (R - L + 1 < k) return;
  for (int i = L; i <= R; ++i) t2[i] = a[i];
  sort(t2 + L, t2 + R + 1);
  for (int i = L; i + k - 1 <= R; ++i) tmp[tn++] = t2[i];
}
int check() {
  tn = 0;
  int L = 1;
  for (int R = 1; R <= n; ++R)
    if (ban[R]) ins(L, R - 1), L = R + 1;
  ins(L, n);
  if (tn < q) return INF;
  sort(tmp, tmp + tn);
  return tmp[q - 1] - tmp[0];
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k >> q;
  for (int i = 1; i <= n; ++i) cin >> a[i], r[i] = i;
  sort(r + 1, r + n + 1, cmp);
  int ans = INF;
  for (int i = 1; i + q - 1 <= n; ++i) {
    for (int j = 1; j <= n; ++j) ban[i] = 0;
    for (int j = 1; j < i; ++j) ban[r[i]] = 1;
    ans = min(ans, check());
  }
  cout << ans << endl;
  return 0;
}
