#include <bits/stdc++.h>
using namespace std;
const long long int INF = (1LL << 50);
template <class S, class T>
std::ostream& operator<<(std::ostream& os, pair<S, T> a) {
  os << "(" << a.first << "," << a.second << ")";
  return os;
}
template <class T>
std::ostream& operator<<(std::ostream& os, vector<T> a) {
  os << "[ ";
  for (int i = 0; i < a.size(); i++) {
    os << a[i] << " ";
  }
  os << " ]";
  return os;
}
void solve(long long N, long long K, long long Q, std::vector<long long> A) {
  auto AA = A;
  sort(AA.begin(), AA.end());
  long long int l = 0;
  long long int ans = AA[Q - 1] - AA[0];
  while (l < N) {
    long long int cnt = 0;
    long long int sum = 0;
    for (int i = 0; i < N; i++) {
      if (A[i] != AA[l]) {
        cnt++;
      } else {
        sum += max(0LL, cnt - K + 1);
        cnt = 0;
      }
    }
    if (sum < Q) {
      break;
    }
    ans = min(ans, AA[l + Q] - AA[l + 1]);
    l++;
  }
  cout << ans << endl;
}
int main() {
  long long N;
  scanf("%lld", &N);
  long long K;
  scanf("%lld", &K);
  long long Q;
  scanf("%lld", &Q);
  std::vector<long long> A(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &A[i]);
  }
  solve(N, K, Q, std::move(A));
  return 0;
}
