#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
void mysort(vector<long long> &a) { sort(a.begin(), a.end()); }
int main() {
  ll n, k, q;
  cin >> n >> k >> q;
  vll a(n);
  for (auto &i : a) cin >> i;
  vll b = a;
  mysort(b);
  ll ans = b.at(q - 1) - b.at(0);
  set<int> s;
  for (int i = 1; i < n; i++) {
    if (b.at(i) == b.at(i - 1)) continue;
    vll c(0), sub(0), none(0);
    for (int j = 0; j < n; j++) {
      if (a.at(j) == b.at(i - 1)) s.insert(j);
    }
    int cnt = 0;
    bool ok = true;
    for (int j = 0; j < n; j++) {
      if (s.count(j)) {
        if (cnt < k) {
          ok = false;
          break;
        } else {
          mysort(sub);
          for (int l = 0; l < min(q, cnt - k + 1); l++) {
            c.emplace_back(sub.at(l));
          }
          sub = none;
          cnt = 0;
        }
      } else {
        cnt++;
        sub.emplace_back(a.at(j));
      }
    }
    if (!ok) break;
    if (sub.size() > 0) {
      mysort(sub);
      for (int j = 0; j < min(q, cnt - k + 1); j++) {
        c.emplace_back(sub.at(j));
      }
    }
    if (c.size() < q) break;
    mysort(c);
    ans = min(ans, c.at(q - 1) - c.at(0));
  }
  cout << ans << endl;
}
