#include <bits/stdc++.h>
using namespace std;
using lint = long long;
int N, K, Q, arr[2000], sorted[2000];
vector<tuple<int, int>> subseq;
lint calc(int lb) {
  subseq.clear();
  int last = 0;
  for (int n = 0; n < N; n++) {
    if (arr[n] < lb) {
      if (last == n) {
        last = n + 1;
      } else {
        subseq.emplace_back(last, n);
        last = n + 1;
      }
    }
  }
  priority_queue<int> pq;
  vector<int> lst;
  if (last < N) subseq.emplace_back(last, N);
  for (auto &seq : subseq) {
    int b, e;
    tie(b, e) = seq;
    if (e - b >= K) {
      for (int i = b, sz = e - b - K + 1; i < e; i++) {
        pq.push(arr[i]);
        if (pq.size() > sz) pq.pop();
      }
      while (!pq.empty()) {
        lst.push_back(pq.top());
        pq.pop();
      }
    }
  }
  if (lst.size() < Q)
    return 0x3f3f3f3f3f3f3f3f;
  else {
    sort(lst.begin(), lst.end());
    return lst[Q - 1];
  }
}
lint ans = 0x3f3f3f3f3f3f3f3f;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> K >> Q;
  for (int n = 0; n < N; n++) cin >> arr[n];
  for (int n = 0; n < N; n++) sorted[n] = arr[n];
  sort(sorted, sorted + N);
  for (int lbi = 0, lb = sorted[0]; lbi < N; lb = sorted[++lbi]) {
    lint ub;
    ans = min(ans, (ub = calc(lb)) - lb);
    if (ub == 0x3f3f3f3f3f3f3f3f) break;
  }
  cout << ans << '\n';
  return 0;
}
