#include <bits/stdc++.h>
using namespace std;
using i64 = long long int;
using ii = pair<int, int>;
using ii64 = pair<i64, i64>;
int main() {
  int n, k, q;
  scanf("%d %d %d", &n, &k, &q);
  vector<int> arr(n);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  vector<int> sorted = arr;
  sort(sorted.begin(), sorted.end());
  int ans = sorted.back() - sorted[0];
  for (int i = 0; i < n - q; i++) {
    i64 lo = sorted[i];
    i64 hi = sorted.back();
    int l = -1;
    while (lo <= hi) {
      i64 mid = (lo + hi) / 2;
      int c = 0;
      int s = 0;
      int prev = 0;
      for (int j = 0; j < n; j++) {
        if (arr[j] < sorted[i]) {
          if (j - prev >= k + s - 1) c += s;
          prev = j;
          s = 0;
        } else if (arr[j] <= mid)
          s++;
      }
      if (n - prev >= k + s - 1) c += s;
      if (c >= q) {
        l = mid;
        hi = mid - 1;
      } else {
        lo = mid + 1;
      }
    }
    if (l != -1) ans = min(ans, l - sorted[i]);
  }
  printf("%d\n", ans);
  return 0;
}
