#include <bits/stdc++.h>
using ll = long long;
int main() {
  int N, K, Q;
  std::cin >> N >> K >> Q;
  std::vector<ll> A(N);
  std::map<ll, std::vector<int>> mp;
  for (int i = 0; i < N; i++) {
    std::cin >> A[i], mp[A[i]].push_back(i);
  }
  auto B = A;
  std::sort(B.begin(), B.end());
  ll ans = B[Q - 1] - B[0];
  std::vector<bool> ok(N, true);
  for (int i = 1; i < N; i++) {
    const ll L = B[i - 1];
    for (const auto e : mp[L]) {
      ok[e] = false;
    }
    std::vector<ll> v;
    std::vector<ll> buf;
    buf.reserve(N);
    for (int pos = 0; pos < N; pos++) {
      if (ok[pos]) {
        buf.push_back(A[pos]);
      } else {
        if (buf.size() > K - 1) {
          std::sort(buf.begin(), buf.end());
          for (int i = 0; i < buf.size() - K + 1; i++) {
            v.push_back(buf[i]);
          }
        }
        buf.clear();
      }
    }
    if (v.size() < Q) {
      break;
    }
    std::sort(v.begin(), v.end());
    ans = std::min(ans, v[Q - 1] - B[i]);
  }
  std::cout << ans << std::endl;
  return 0;
}
