#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long linf = 1LL << 62;
const int MAX = 510000;
long long dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
long long dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const double pi = acos(-1);
const double eps = 1e-7;
template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {
  if (a > b) {
    a = b;
    return true;
  } else
    return false;
}
template <typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {
  if (a < b) {
    a = b;
    return true;
  } else
    return false;
}
template <typename T1, typename T2>
inline void print2(T1 a, T2 b) {
  cout << a << " " << b << endl;
}
template <typename T1, typename T2, typename T3>
inline void print3(T1 a, T2 b, T3 c) {
  cout << a << " " << b << " " << c << endl;
}
const int mod = 1e9 + 7;
int main() {
  long long n, k, q;
  cin >> n >> k >> q;
  vector<long long> a(n);
  for (long long i = 0; i < (n); i++) cin >> a[i];
  vector<pair<long long, long long> > b(n + 1,
                                        pair<long long, long long>(inf, inf));
  for (long long i = 0; i < (n); i++) {
    b[i].first = a[i];
    b[i].second = i;
  }
  sort((b).begin(), (b).end());
  long long now = b[0].first;
  long long id = 0;
  set<long long> se;
  long long ans = linf;
  while (id < n) {
    vector<long long> v;
    for (long long i = 0; i < (n); i++) {
      if (se.empty()) {
        v.push_back(a[i]);
        continue;
      }
      auto itr = se.upper_bound(i - k);
      if (itr == se.end() || *itr >= i + k) v.push_back(a[i]);
    }
    if (v.size() >= q) {
      sort((v).begin(), (v).end());
      chmin(ans, v[q - 1] - v[0]);
    }
    while (id < n && now == b[id].first) {
      se.insert(b[id].second);
      id++;
    }
    now = b[id].first;
  }
  cout << ans << endl;
}
