#include <bits/stdc++.h>
using namespace std;
int N, K, Q;
int main() {
  cin >> N >> K >> Q;
  vector<pair<int, int> > v(N);
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    v[i] = pair<int, int>(A[i], i);
  }
  sort(v.begin(), v.end());
  vector<int> fix;
  fix.push_back(-1);
  int ans = v[Q - 1].first - v[0].first;
  for (int i = 0; i < N - Q; i++) {
    fix.push_back(v[i].second);
    fix.push_back(N);
    vector<int> u;
    for (int j = 0; j < fix.size() - 1; j++) {
      priority_queue<int> Q;
      if (fix[j + 1] - fix[j] > K) {
        for (int k = fix[j] + 1; k < fix[j + 1]; k++) {
        }
      }
      while (Q.size()) {
        int a = Q.top();
        u.push_back(-a);
        Q.pop();
      }
    }
    sort(u.begin(), u.end());
    if (u.size() >= Q) ans = min(ans, u[Q - 1] - u[0]);
    fix.pop_back();
  }
  cout << ans << endl;
}
