#include <bits/stdc++.h>
using namespace std;
const int maxn = 300300;
char s[maxn];
int p[maxn], a[maxn], bad[maxn];
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  for (int e = 0; e < n; e++) cin >> p[e];
  memcpy(a, p, sizeof(a));
  sort(a, a + n);
  int best = 1e9;
  for (int e = 0; e < n; e++) {
    int lo = e, hi = n - 1;
    while (lo <= hi) {
      int mid = (lo + hi) >> 1;
      int L = a[e], R = a[mid];
      set<pair<int, int> > sweep;
      int bg = 0, ed = 0;
      for (int f = 0; f < n; f++) bad[f] = 0;
      for (int f = 0; f < k; f++, ed++) sweep.insert(make_pair(p[ed], ed));
      int ops = 0;
      for (int f = 0; f < n && ops < q; f++) {
        auto it = *sweep.begin();
        if (L <= it.first && it.first <= R) {
          bad[it.second] = 1;
          sweep.erase(sweep.begin());
          ops++;
        } else {
          while (bg < n && bad[bg]) bg++;
          sweep.erase(make_pair(p[bg], bg));
          bad[bg] = 1;
        }
        if (ed == n) break;
        sweep.insert(make_pair(p[ed], ed));
        ed++;
      }
      if (ops >= q) {
        best = min(best, R - L);
        hi = mid - 1;
      } else {
        lo = mid + 1;
      }
    }
  }
  cout << best << endl;
  return 0;
}
