#include <bits/stdc++.h>
using namespace std;
long long N, M, H, W, K, Q, A, B, C, L, R;
string S, T;
const long long MOD = (1e+9) + 7;
const long long INF = 1LL << 59;
const long double EPS = 1e-9;
int main() {
  cin >> N >> K >> Q;
  vector<long long> a(N), ord(N), sta(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  for (int i = 0; i < N; i++) ord[i] = i;
  sort(ord.begin(), ord.end(),
       [&](long long x, long long y) { return a[x] < a[y]; });
  set<long long> ID = {-1};
  ID.insert(N);
  vector<long long> range(0);
  vector<vector<long long> > r_id(2010, vector<long long>(2010));
  long long range_id = -1, ans = INF, last;
  for (int i = 0; i < N; i++) {
    auto ite = ID.begin();
    last = *ite;
    ++ite;
    range.push_back(*ite - last - 1);
    ++range_id;
    for (int j = 0; j < N; j++) {
      if (j == *ite) {
        last = *ite;
        ++ite;
        range.push_back(*ite - last - 1);
        ++range_id;
      } else {
        r_id[i][j] = range_id;
      }
    }
    long long q = Q, temp, mini;
    for (int j = i; j < N; j++) {
      if (range[r_id[i][ord[j]]] >= K) {
        if (q == Q) mini = a[ord[j]];
        temp = a[ord[j]];
        --range[r_id[i][ord[j]]];
        --q;
      }
      if (q == 0) break;
    }
    if (q == 0) {
      ans = min(ans, temp - mini);
    }
    ID.insert(ord[i]);
    while (i + 1 < N) {
      if (a[i] != a[i + 1]) break;
      ID.insert(ord[i]);
      ++i;
    }
  }
  cout << ans << endl;
}
