#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
int N, K, Q;
vector<long long int> A;
vector<long long int> B;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> K >> Q;
  A.resize(N);
  B.resize(N);
  for (long long int i = long long int(0); i < long long int(N); i++) {
    cin >> A[i];
    B[i] = A[i];
  }
  sort(B.begin(), B.end());
  B.erase(unique(B.begin(), B.end()), B.end());
  map<long long int, long long int> m;
  map<long long int, long long int> revm;
  for (long long int i = long long int(0); i < long long int((int)(B).size());
       i++) {
    m[B[i]] = i;
    revm[i] = B[i];
  }
  for (long long int i = long long int(0); i < long long int(N); i++) {
    A[i] = m[A[i]];
  }
  long long int ans = 1e12;
  int n = (int)(B).size();
  for (long long int i = long long int(0); i < long long int(n); i++) {
    int ng = -1, ok = n - i;
    while (ok - ng > 1) {
      int mid = (ok + ng) / 2;
      int l = 0, r = 0;
      int cnt = 0;
      int res = 0;
      while (l < N) {
        cnt = 0;
        while (r < N && A[r] < i) {
          r++;
        }
        l = r;
        while (r < N && A[r] >= i) {
          if (A[r] <= i + mid) cnt++;
          r++;
        }
        res += min(r - l - K + 1, cnt);
        l = r;
      }
      if (res >= Q)
        ok = mid;
      else
        ng = mid;
    }
    if (ok == n - i)
      continue;
    else
      ans = min(ans, revm[i + ok] - revm[i]);
  }
  cout << ans << "\n";
}
