#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  for (auto &e : a) {
    cin >> e;
  }
  set<int> s;
  for (auto e : a) {
    s.insert(e);
  }
  vector<int> v;
  for (auto e : s) {
    v.push_back(e);
  }
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    m[v[i]] = i;
  }
  for (auto &e : a) {
    e = m[e];
  }
  int mm = v.back() - v.front();
  for (int i = 0; i < v.size() - k; i++) {
    vector<int> t;
    for (int l = 0, r = 0; r < n;) {
      if (a[r] >= i) {
        t.push_back(a[r]);
        r++;
      } else {
        t.clear();
        r++;
        l = r;
      }
    }
    sort(begin(t), end(t));
    if (t.size() >= q) {
      mm = min(mm, v[t[q - 1]] - v[t[0]]);
    }
  }
  cout << mm << endl;
  return 0;
}
