#include <bits/stdc++.h>
using namespace std;
constexpr int inf = 1e9;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  auto b = a;
  sort(begin(b), end(b));
  b.erase(unique(begin(b), end(b)), end(b));
  int ans = inf;
  vector<int> sum(n + 1);
  for (int i = 0; i < (int)b.size(); ++i) {
    vector<int> c;
    for (int j = 0; j < n; ++j) {
      if (sum[j] == 0) {
        c.push_back(a[j]);
      }
    }
    if ((int)c.size() < q) break;
    sort(begin(c), end(c));
    ans = min(ans, c[q - 1] - b[i]);
    vector<int> tsum(n + 1);
    for (int j = 0; j < n; ++j) {
      if (a[j] == c[i]) {
        tsum[max(0, j - k + 1)] += 1;
        tsum[min(n, j + k)]--;
      }
    }
    for (int j = 0; j < n; ++j) {
      tsum[j + 1] += tsum[j];
      sum[j] += tsum[j];
    }
  }
  cout << ans << endl;
}
