#include <bits/stdc++.h>
using namespace std;
int n, k, q, a[2005], sz[2005], reg[2005], tot, ans = 1000000005, fb[2005],
                                                fen[2005];
vector<pair<int, int> > v;
set<int> se;
void forbid(int ind, int val) {
  int i = v[ind].second;
  fb[i] += val;
  if (fb[i] == 1) se.insert(i);
  if (fb[i] == 0) se.erase(se.find(i));
}
void up(int plc) {
  for (int i = plc; i <= n; i += (i & -i)) fen[i]++;
}
int get(int plc) {
  int res = 0;
  for (int i = plc; i > 0; i -= (i & -i)) res += fen[i];
  return res;
}
bool valid(int plc) {
  auto pos = lower_bound(se.begin(), se.end(), plc);
  int bas = *prev(pos);
  int son = *pos;
  int rem = get(son - 1) - get(bas);
  if (son - bas - 1 - rem < k) return false;
  return true;
}
int main() {
  scanf("%d %d %d", &n, &k, &q);
  se.insert(0);
  se.insert(n + 1);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    v.push_back({a[i], i});
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < (int)v.size() - q + 1; i++) {
    memset(fen, 0, sizeof(fen));
    int now = 0;
    vector<int> rev;
    for (int j = i; j < (int)v.size(); j++) {
      if (now == q) break;
      if (valid(v[j].second)) {
        up(v[j].second);
        now++;
      } else {
        forbid(j, 1);
        rev.push_back(j);
      }
    }
    if (now == q) ans = min(ans, v[i + q - 1].first - v[i].first);
    for (int x : rev) forbid(x, -1);
    forbid(i, 1);
  }
  printf("%d", ans);
}
