#include <bits/stdc++.h>
using namespace std;
long long int A[10001], B[10001], M[10001];
set<pair<int, int> > s;
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  long long int x, y, z, i, j, n, k, q, a, b, ans = 1e18;
  cin >> n >> k >> q;
  for (i = 1; i <= n; ++i) {
    cin >> A[i];
    B[i] = A[i];
  }
  sort(B + 1, B + n + 1);
  s.insert(make_pair(1ll, n));
  long long int tot_moves = (n - k + 1);
  for (i = q; i <= n; ++i) {
    long long int tmp = B[i] - B[i - q + 1];
    ans = min(ans, tmp);
    x = B[i - q + 1];
    long long int cur = 0;
    long long int moves = 0;
    long long int ids, ide, idm;
    for (auto it : s) {
      long long int start = it.first;
      long long int end = it.second;
      for (j = start; j <= end; ++j) {
        if (A[j] == x) {
          a = start;
          b = j - 1;
          if (b - a + 1 >= k) cur += (b - a + 1 - k + 1);
          a = j + 1;
          b = end;
          if (b - a + 1 >= k) cur += (b - a + 1 - k + 1);
          cur = tot_moves + cur;
          if (end - start + 1 >= k) cur -= (end - start + 1 - k + 1);
          if (cur > moves) {
            moves = cur;
            ids = start;
            ide = end;
            idm = j;
          } else if (cur == moves) {
            a = min(idm - ids, ide - idm);
            b = min(j - start, end - j);
            if (b < a) {
              ids = start;
              ide = end;
              idm = j;
            }
          }
        }
      }
    }
    if (moves < q) break;
    s.erase(make_pair(ids, ide));
    s.insert(make_pair(ids, idm - 1));
    s.insert(make_pair(idm + 1, ide));
    tot_moves = moves;
  }
  cout << ans << endl;
  return 0;
}
