#include <bits/stdc++.h>
using namespace std;
const int maxn = 2010;
int Tree[maxn];
int res;
set<int> S;
int N, K, Q;
void renew(int x, int val) {
  while (x <= N + 1) {
    Tree[x] += val;
    x += (x & (-x));
  }
  return;
}
int query(int x) {
  int ans = 0;
  while (x > 0) {
    ans += Tree[x];
    x -= (x & (-x));
  }
  return ans;
}
struct Node {
  int val;
  int pos;
} node[maxn];
bool cmp(const Node &a, const Node &b) { return a.val < b.val; }
void init() {
  int val;
  for (int i = 0; i < N; i++) {
    scanf("%d", &val);
    node[i].val = val;
    node[i].pos = i + 1;
  }
  S.insert(N + 1);
  S.insert(0);
  sort(node, node + N, cmp);
}
void judge() {
  for (int i = 0; i < Q; i++) {
    renew(node[i].pos, 1);
  }
  res = node[Q - 1].val - node[0].val;
  for (int i = Q; i < N; i++) {
    renew(node[i - Q].pos, -1);
    renew(node[i].pos, 1);
    S.insert(node[i - Q].pos);
    set<int>::iterator it = S.end();
    it--;
    int flag = 0;
    for (set<int>::iterator iter = S.begin(); iter != it; iter++) {
      iter++;
      set<int>::iterator nxt = iter;
      iter--;
      if (query(*nxt) - query(*iter) == 0 ||
          query(*nxt) - query(*iter) + K <= ((*nxt) - (*iter))) {
      } else {
        flag = 1;
        break;
      }
    }
    if (!flag) {
      int now = node[i].val - node[i - Q + 1].val;
      if (now < res) res = now;
    }
  }
  cout << res << endl;
  return;
}
int main() {
  cin >> N >> K >> Q;
  init();
  judge();
  return 0;
}
