#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int ADD(int a, int b, int m = mod) {
  int s = a;
  s += b;
  if (s >= m) s -= m;
  return s;
}
int MUL(int a, int b, int m = mod) { return (1LL * a * b % m); }
int power(int a, int b, int m = mod) {
  int res = 1;
  while (b) {
    if (b & 1) {
      res = 1LL * res * a % m;
    }
    a = 1LL * a * a % m;
    b /= 2;
  }
  return res;
}
long long int nC2(long long int x) { return (x * (x - 1) / 2); }
class dsu {
 public:
  int n, max_component, ans = 0, k;
  vector<int> P, R, S;
  dsu(int n, int k) {
    this->n = n;
    this->k = k;
    P.resize(n + 1);
    R.resize(n + 1);
    S.resize(n + 1);
    for (int i = 1; i <= n; i++) {
      R[i] = 0;
      P[i] = i;
      S[i] = 0;
    }
    max_component = 1;
    ans = 0;
  }
  int find(int x) {
    if (x != P[x]) {
      P[x] = find(P[x]);
    }
    return P[x];
  }
  bool add_edge(int x, int y) {
    int rx, ry;
    rx = find(x);
    ry = find(y);
    if (rx != ry) {
      if (R[rx] < R[ry]) {
        P[rx] = ry;
        ans -= max(0, S[ry] - k + 1);
        ans -= max(0, S[rx] - k + 1);
        S[ry] += S[rx];
        ans += max(0, S[ry] - k + 1);
        max_component = max(max_component, S[ry]);
      } else {
        P[ry] = rx;
        ans -= max(0, S[ry] - k + 1);
        ans -= max(0, S[rx] - k + 1);
        S[rx] += S[ry];
        ans += max(0, S[rx] - k + 1);
        max_component = max(max_component, S[rx]);
      }
      if (R[rx] == R[ry]) {
        R[rx]++;
      }
      return true;
    }
    return false;
  }
  void add(int x) {
    if (!S[x]) {
      S[x] = 1;
      ans += max(0, S[x] - k + 1);
    }
  }
};
const int maxn = 1e5 + 10;
bool vis[maxn];
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  int i;
  vector<pair<int, int> > A;
  for (i = 1; i <= n; i++) {
    int x;
    cin >> x;
    A.push_back(make_pair(x, i));
  }
  dsu ds(n, k);
  sort(A.begin(), A.end());
  reverse(A.begin(), A.end());
  i = 0;
  vector<pair<int, int> > Z;
  int last = 0;
  while (i < n) {
    int x = A[i].first;
    while (i < n && x == A[i].first) {
      vis[A[i].second] = 1;
      ds.add(A[i].second);
      if (vis[A[i].second - 1]) ds.add_edge(A[i].second - 1, A[i].second);
      if (vis[A[i].second + 1]) ds.add_edge(A[i].second + 1, A[i].second);
      i++;
    }
    Z.push_back(make_pair(x, ds.ans - last));
    last = ds.ans;
  }
  i = 0;
  int j = 0, fans = 2 * 1e9 + 10;
  int sum = 0;
  while (i < Z.size()) {
    while (j < Z.size() && sum < q) {
      sum += A[j].second;
      j++;
    }
    if (j < Z.size()) fans = min(fans, Z[i].first - Z[j].first);
    sum -= A[i].second;
    i++;
  }
  cout << fans << "\n";
  return 0;
}
