#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int n, m, q, a[N], ans;
bool check(int L, int R) {
  multiset<pair<int, int> > Q;
  set<int> idxs;
  int ret = 0;
  for (int i = 0; i < n; i++) {
    Q.insert({a[i], i});
    idxs.insert(i);
    if (Q.size() == m) {
      pair<int, int> ltl = *Q.begin();
      if (ltl.first >= L && ltl.first <= R) {
        ret++;
        Q.erase(Q.begin());
        idxs.erase(ltl.second);
      } else {
        int ix = *idxs.begin();
        Q.erase({a[ix], ix});
        idxs.erase(ix);
      }
    }
  }
  return ret >= q;
}
int main() {
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  ans = 1000000000;
  for (int i = 0; i < n; i++) {
    int l = a[i], r = 1000000000;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (check(a[i], mid)) {
        ans = min(mid - a[i], ans);
        r = mid - 1;
      } else
        l = mid + 1;
    }
  }
  cout << ans;
  return 0;
}
