#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<bool> b(n, true);
  vector<P> s(n);
  for (int i = 0; i < n; i++) {
    s[i].first = a[i];
    s[i].second = i;
  }
  sort(s.begin(), s.end());
  int res = 2e9;
  for (int i = 0; i < n; i++) {
    int t = 0, ii = 0, ma;
    for (int j = 0; j < n; j++) {
      if (b[s[j].second]) t++;
      if (t == q) ma = a[s[j].second];
    }
    if (t < q) continue;
    res = min(res, ma - a[s[i].second]);
    for (int j = -k; j <= k; j++) {
      if (s[i].second + j < 0 or s[i].second + j >= n or
          b[s[i].second] == false) {
        if (j < 0) {
          for (int l = max(s[i].second + j, 0); l <= 0; l++) {
            b[l] = false;
          }
        } else if (j > 0) {
          for (int l = min(s[i].second + j, n - 1); l >= 0; l--) {
            b[l] = false;
          }
        }
      }
    }
  }
  cout << res << '\n';
  return 0;
}
