#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using VI = vector<int>;
using VVI = vector<VI>;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  VI a(n), ta;
  for (int i = 0; i < (n); ++i) cin >> a[i];
  ta = a;
  sort((ta).begin(), (ta).end());
  ta.erase(unique((ta).begin(), (ta).end()), ta.end());
  int ans = 1001001001;
  vector<bool> discarded(n, false);
  for (int i = 0; i < (ta.size()); ++i) {
    int l = 0;
    priority_queue<int, VI, greater<int>> p, cur_p;
    for (int r = 0; r < (n); ++r) {
      if (discarded[r]) {
        int cnt = max(0, r - l - k + 1);
        while (cnt-- && !cur_p.empty()) {
          p.push(cur_p.top());
          cur_p.pop();
        }
        while (!cur_p.empty()) cur_p.pop();
        l = r + 1;
      } else {
        cur_p.push(a[r]);
      }
    }
    int cnt = max(0, n - l - k + 1);
    while (cnt-- && !cur_p.empty()) {
      p.push(cur_p.top());
      cur_p.pop();
    }
    if (p.size() < q) {
      break;
    }
    int mn, mx;
    mn = p.top();
    p.pop();
    for (int _ = 0; _ < (q - 1); ++_) {
      mx = p.top();
      p.pop();
    }
    ans = min(ans, mx - mn);
    for (int j = 0; j < (n); ++j)
      if (a[j] == ta[i]) discarded[j] = true;
  }
  cout << ans << endl;
}
