#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K, Q;
  while (cin >> N >> K >> Q) {
    vector<int> A(N);
    for (int& t : A) cin >> t;
    vector<int> thr = A;
    thr.push_back(0);
    sort(thr.begin(), thr.end());
    thr.erase(unique(thr.begin(), thr.end()), thr.end());
    vector<int> part;
    part.reserve(N);
    vector<int> cur;
    cur.reserve(N);
    long long res = 1LL << 60;
    for (const auto& wall : thr) {
      part.clear();
      cur.clear();
      auto pushPart = [&]() {
        if (part.empty()) return;
        sort(part.begin(), part.end());
        for (int j = 0; j < part.size() - K + 1; j++) {
          cur.push_back(part[j]);
        }
        part.clear();
      };
      for (int i = 0; i < N; i++) {
        if (A[i] <= wall) {
          pushPart();
        } else {
          part.push_back(A[i]);
        }
      }
      if (!part.empty()) {
        pushPart();
      }
      if (cur.size() < Q) break;
      sort(cur.begin(), cur.end());
      res = min(res, (long long)cur[Q - 1] - cur[0]);
    }
    cout << res << endl;
  }
}
