#include <bits/stdc++.h>
using namespace std;
using Z = int;
constexpr Z INF = numeric_limits<Z>::max();
class fenwick {
 private:
  Z n;
  vector<Z> data;

 public:
  fenwick(Z n) : n(n), data(n + 1) {}
  Z sum(Z x) {
    x++;
    Z total = 0;
    for (Z i = x; i > 0; i -= i & -i) total += data.operator[](i);
    return total;
  }
  void add(Z x, Z v) {
    x++;
    for (Z i = x; i <= n; i += i & -i) data.operator[](i) += v;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  using pz = pair<Z, Z>;
  Z n, K, q;
  cin >> n >> K >> q;
  vector<Z> as(n);
  for (auto& a : as) cin >> a;
  vector<pz> sorted(n);
  for (auto i = 0; i < n; i++) {
    sorted[i].first = as[i];
    sorted[i].second = i;
  }
  sort(begin(sorted), end(sorted));
  set<Z> removed;
  Z minimum = INF;
  for (auto i = 0; i < n; i++) {
    ;
    Z first = -1, last = -1;
    Z k = i;
    fenwick fwt(n);
    for (auto j = 0; j < n; j++)
      if (!removed.count(j)) fwt.add(j, 1);
    ;
    for (auto j = 0; j < q; j++) {
      for (; k < n; k++) {
        auto right = removed.lower_bound(sorted[k].second);
        Z li, ri;
        ri = right == end(removed) ? n : *right;
        if (right == begin(removed))
          li = -1;
        else {
          right--;
          li = *right;
        };
        ;
        Z sz = fwt.sum(ri - 1) - fwt.sum(li);
        ;
        ;
        ;
        if (sz >= K) {
          ;
          fwt.add(sorted[k].second, -1);
          if (j == 0) first = sorted[k].first;
          last = sorted[k].first;
          k++;
          break;
        }
      }
    }
    if (k == n) break;
    ;
    ;
    minimum = min(minimum, last - first);
    ;
    removed.insert(sorted[i].second);
  }
  cout << minimum << endl;
  return 0;
}
