#include <bits/stdc++.h>
using namespace std;
template <typename X>
bool exist(vector<X> vec, X item) {
  return find(vec.begin(), vec.end(), item) != vec.end();
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long N, K, Q;
vector<long long> A;
vector<long long> lst;
bool check(long long value) {
  long long cnt = 0;
  long long ret = 0;
  for (long long i = (long long)0; i < (long long)N; i++) {
    if (A[i] >= value) {
      cnt++;
    } else {
      if (cnt >= K) ret += (cnt - K + 1);
      cnt = 0;
    }
  }
  if (ret >= Q)
    return true;
  else
    return false;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N >> K >> Q;
  for (long long i = (long long)0; i < (long long)N; i++) {
    long long inp;
    cin >> inp;
    A.push_back(inp);
    lst.push_back(inp);
  }
  sort(lst.begin(), lst.end());
  if (Q == 1) {
    cout << 0 << endl;
    return 0;
  }
  long long l = 0;
  long long r = lst.size() - 1;
  while (l + 1 < r) {
    long long m = (l + r) / 2;
    long long value = lst[(l + r) / 2];
    if (check(value))
      l = m;
    else
      r = m;
  }
  long long ans = 10000000000;
  for (long long i = (long long)0; i < (long long)l + 1; i++) {
    ans = min(lst[i + Q - 1] - lst[i], ans);
  }
  cout << ans << endl;
  return 0;
}
