#include <bits/stdc++.h>
using namespace std;
long long N, K, Q;
long long a[2000];
bool canRemove(long long mi, long long ma) {
  long long maxRemove = 0;
  long long size = 0;
  long long greater_max = 0;
  long long less_max = 0;
  for (long long i = 1; i <= N + 1; i++) {
    if (a[i] < mi || i == N + 1) {
      maxRemove += max(0LL, min(size - K + 1, less_max));
      less_max = greater_max = size = 0;
      continue;
    }
    size++;
    if (a[i] > ma)
      greater_max++;
    else
      less_max++;
  }
  if (maxRemove >= Q) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> N >> K >> Q;
  for (long long i = 1; i <= N; i++) cin >> a[i];
  vector<long long> b(a + 1, a + N + 1);
  sort(b.begin(), b.end());
  std::vector<long long>::iterator it;
  it = std::unique(b.begin(), b.end());
  b.resize(std::distance(b.begin(), it));
  long long ans = b.back() - b[0];
  for (long long i = 0; i <= b.size() - 1; i++) {
    if (!canRemove(b[i], b.back())) break;
    long long mi = i;
    long long ma = b.size() - 1;
    while (mi < ma) {
      long long mid = (mi + ma) / 2;
      if (canRemove(b[i], b[mid])) {
        ma = mid;
      } else {
        mi = mid + 1;
      }
    }
    ans = min(ans, b[ma] - b[i]);
  }
  cout << ans;
}
