#include <bits/stdc++.h>
using namespace std;
void read(long long &x) { scanf("%lld", &x); }
void read(long long &x, long long &y) { scanf("%lld%lld", &x, &y); }
void read(long long &x, long long &y, long long &z) {
  scanf("%lld%lld%lld", &x, &y, &z);
}
void print(long long x) { printf("%lld ", x); }
void println(long long x) { printf("%lld\n", x); }
const long long N = 2000;
long long n, k, q, a[N + 10], l, r, mid, b[N + 10], ans;
long long f(long long x) {
  long long ans = 0, cnt = 0;
  for (long long i = 1; i <= n; i++) {
    if (a[i] <= x) {
      if (cnt >= k) ans += cnt - k + 1;
      cnt = 0;
    } else
      cnt++;
  }
  if (cnt >= k) ans += cnt - k + 1;
  return ans >= q;
}
int main() {
  cin >> n >> k >> q;
  for (long long i = 1; i <= n; i++) read(a[i]), b[i] = a[i];
  sort(b + 1, b + n + 1);
  b[0] = 0;
  l = 0, r = n;
  while (l < r) {
    mid = (l + r + 1) / 2;
    if (f(b[mid]))
      l = mid;
    else
      r = mid - 1;
  }
  ans = b[n];
  for (long long i = 1; i <= l + 1; i++) ans = min(ans, b[i + q - 1] - b[i]);
  cout << ans;
}
