#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll inf = numeric_limits<ll>::max() / 3;
int main(void) {
  int n, k, q;
  cin >> n >> k >> q;
  vector<ll> a;
  vector<P> sorted;
  for (int i = 0; i < n; ++i) {
    ll tmp;
    cin >> tmp;
    a.push_back(tmp);
    sorted.push_back(P(tmp, i));
  }
  sort(sorted.begin(), sorted.end());
  ll res = inf;
  int alive[2010];
  fill(alive, alive + 2010, 1);
  alive[n] = 0;
  for (auto pa : sorted) {
    ll val, idx;
    tie(val, idx) = pa;
    if (!alive[idx]) continue;
    vector<ll> ok;
    vector<ll> st;
    for (int i = 0; i <= n; ++i) {
      if (alive[i]) {
        st.push_back(a[i]);
      } else {
        sort(st.begin(), st.end());
        for (int j = 0; j < (int)st.size() - k + 1; ++j) {
          ok.push_back(st[j]);
        }
        st.clear();
      }
    }
    if (ok.size() < q) break;
    res = min(res, ok[q - 1] - val);
    alive[idx] = 0;
  }
  cout << res << endl;
  return 0;
}
