#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  int under = 2001, upper = 0;
  vector<int> a(n), sorted(n);
  copy_n(istream_iterator<int>(cin), n, (a).begin());
  ;
  copy(a.begin(), a.end(), sorted.begin());
  sort(sorted.begin(), sorted.end());
  int ans = 2001;
  list<int> selected;
  for (vector<int>::iterator base = sorted.begin(); base != sorted.end();
       base++) {
    int limit = *base - 1;
    int start = 0, end = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] > limit) continue;
      end = i;
      if (end - start < k) {
        start = end + 1;
        continue;
      }
      vector<int> seg(end - start);
      for (int i = 0; i < end - start; i++) {
        seg[i] = a[i + start];
      }
      sort(seg.begin(), seg.end());
      for (int i = 0; i < seg.size() - k + 1; i++) {
        selected.push_front(seg[i]);
      }
      start = end + 1;
    }
    end = n;
    if (end - start >= k) {
      vector<int> seg(end - start);
      for (int i = 0; i < end - start; i++) {
        seg[i] = a[i + start];
      }
      sort(seg.begin(), seg.end());
      for (int i = 0; i < seg.size() - k + 1; i++) {
        selected.push_front(seg[i]);
      }
    }
    if (selected.size() < q) {
      selected.clear();
      continue;
    }
    selected.sort();
    list<int>::iterator i = selected.begin();
    for (int j = 0; j < q - 1; j++) {
      ++i;
    }
    int prob_ans = *i - *(selected.begin());
    ans = min(ans, prob_ans);
    selected.clear();
  }
  cout << ans << endl;
  return 0;
}
