#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(N);
  vector<pair<int, int>> IA(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    IA[i] = make_pair(A[i], i);
  }
  sort(IA.begin(), IA.end());
  int ans = IA[Q - 1].first - IA[0].first;
  set<int> st = {N};
  for (int i = 0; i < N; i++) {
    st.insert(IA[i].second);
    int l = -1;
    vector<int> v = {};
    for (auto r : st) {
      if (r - l - 1 < K) continue;
      vector<int> w = {};
      for (int j = l + 1; j < r; j++) {
        w.push_back(A[j]);
      }
      sort(w.begin(), w.end());
      for (int k = 0; k < r - l - K; k++) {
        v.push_back(w[k]);
      }
      l = r;
    }
    if (v.size() < K + Q - 1) break;
    sort(v.begin(), v.end());
    ans = min(ans, v[Q - 1] - v[0]);
  }
  cout << ans << "\n";
}
