#include <bits/stdc++.h>
using namespace std;
using ULL = unsigned long long;
using UL = unsigned;
using LL = long long;
struct Problem {
  void Solve() {
    UL N, K, Q;
    cin >> N >> K >> Q;
    vector<UL> A(N);
    for (UL i = 0; i < (N); i++) cin >> A[i];
    vector<pair<UL, UL>> sorted;
    for (UL i = 0; i < (N); i++) sorted.push_back({A[i], i});
    sort(sorted.begin(), sorted.end());
    vector<UL> used(N + 1);
    used[N] = 1;
    UL ans = 1000000001;
    for (UL i = 0; i < (N); i++) {
      vector<UL> L;
      vector<UL> buf;
      for (UL j = 0; j < (N + 1); j++) {
        if (used[j]) {
          sort(buf.begin(), buf.end());
          if (buf.size() < K) continue;
          for (UL k = 0; k <= buf.size() - K; k++) L.push_back(buf[k]);
          buf.clear();
        } else {
          buf.push_back(A[j]);
        }
      }
      if (L.size() < Q) break;
      sort(L.begin(), L.end());
      ans = min(ans, L[Q - 1] - L[0]);
      used[sorted[i].second] = 1;
    }
    cout << ans << endl;
  }
  Problem();
};
int main() {
  unique_ptr<Problem> p(new Problem());
  p->Solve();
  return 0;
}
Problem::Problem() { cout << fixed << setprecision(10); }
