#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, q;
  cin >> n >> k >> q;
  vector<long long> xs(n);
  for (int i = 0; i < n; ++i) {
    cin >> xs[i];
  }
  long long ans =
      *max_element(xs.begin(), xs.end()) - *min_element(xs.begin(), xs.end());
  for (int i = 0; i < n; ++i) {
    vector<long long> imp(n + 1);
    for (int j = 0; j < n; ++j) {
      if (xs[j] < xs[i]) {
        imp[max(0LL, j - k + 1)] += 1;
        imp[min(n, j + k)] -= 1;
      }
    }
    for (int j = 0; j < n; ++j) {
      imp[j + 1] += imp[j];
    }
    long long okc = 0;
    vector<long long> rem(n + 1);
    for (int j = 0; j < n; ++j) {
      if (!imp[j]) {
        rem[max(0LL, j - k + 1)] += 1;
        rem[min(n, j + k)] -= 1;
        okc += 1;
      }
    }
    if (okc < q) {
      continue;
    }
    for (int j = 0; j < n; ++j) {
      rem[j + 1] += rem[j];
    }
    vector<long long> remv;
    for (int j = 0; j < n; ++j) {
      if (rem[j]) {
        remv.push_back(xs[j]);
      }
    }
    sort(remv.begin(), remv.end());
    ans = min(ans, remv[q - 1] - remv[0]);
  }
  cout << ans << endl;
  return 0;
}
