#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;
  vector<long long> split;
  split.push_back(-1);
  split.push_back(n);
  long long ans = linf;
  while (id < n) {
    vector<long long> as;
    for (long long i = 0; i < (split.size() - 1); i++) {
      vector<long long> vv;
      for (int j = (split[i] + 1); j < (split[i + 1]); j++) {
        vv.push_back(a[j]);
      }
      if (vv.size() < k) continue;
      sort((vv).begin(), (vv).end());
      for (long long j = 0; j < (vv.size() - k + 1); j++) as.push_back(vv[j]);
    }
    if (as.size() >= q) {
      sort((as).begin(), (as).end());
      for (long long i = 0; i < (as.size() - q + 1); i++) {
        chmin(ans, as[i + q - 1] - as[i]);
      }
    }
    while (id < n && now == b[id].first) {
      split.push_back(b[id].second);
      id++;
    }
    sort((split).begin(), (split).end());
    now = b[id].first;
  }
  cout << ans << endl;
}
