#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, k, q, a[N], b[N];
int check(int mn, int mx) {
  int c1 = 0, c2 = 0;
  int ret = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] < mn) {
      ret += min(c1, max(0, c1 + c2 - k + 1));
      c1 = 0;
      c2 = 0;
    } else if (a[i] >= mn && a[i] <= mx)
      c1++;
    else
      c2++;
  }
  if (a[n] >= mn) ret += min(c1, max(0, c1 + c2 - k + 1));
  return ret;
}
int main() {
  cin >> n >> k >> q;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b + 1, b + 1 + n);
  int ans = 1234567891;
  for (int i = 1; i < n; i++) {
    int l = i + 1, r = n, res = -1;
    while (l <= r) {
      int mid = l + r >> 1;
      if (check(b[i], b[mid]) >= q) {
        res = mid;
        r = mid - 1;
      } else
        l = mid + 1;
    }
    if (res != -1) {
      ans = min(ans, b[res] - b[i]);
    }
  }
  cout << ans << endl;
  return 0;
}
