#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, k, q;
  cin >> n >> k >> q;
  long long a[n + 1];
  for (long long i = (1); i <= (n); i++) {
    cin >> a[i];
  }
  bool use[n + 2];
  memset(use, 0, sizeof(use));
  use[0] = true;
  use[n + 1] = true;
  vector<pair<long long, long long> > pos;
  for (long long i = (1); i <= (n); i++) {
    pos.push_back(pair<long long, long long>(a[i], i));
  }
  sort(pos.begin(), pos.end());
  long long pospos[n + 1];
  for (long long i = (0); i < (n); i++) {
    pospos[pos[i].second] = i;
  }
  long long ans = pos[q - 1].first - pos[0].first;
  long long high = q - 1;
  for (long long low = 0; high < n; low++) {
    long long at = pos[low].second;
    if (!use[at]) {
      use[at] = true;
      long long l = at;
      long long r = at;
      for (long long i = (at + 1); i <= (min(at + k, n + 1)); i++) {
        if (use[i]) {
          r = i;
        }
      }
      for (long long i = (at - 1); i >= (max(at - k, 0LL)); i--) {
        if (use[i]) {
          l = i;
        }
      }
      long long cnt = 1;
      for (long long i = (l); i <= (r); i++) {
        if (!use[i]) {
          use[i] = true;
          if (pospos[i] <= high) {
            cnt++;
          }
        }
      }
      while (cnt > 0 && high < n) {
        high++;
        if (!use[pos[high].second]) {
          cnt--;
        }
      }
      if (high < n) {
        ans = min(pos[high].first - pos[low].first, ans);
      }
    }
  }
  cout << (ans) << endl;
  return 0;
}
