#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
using vec = vector<T>;
class BIT {
 public:
  vector<int> bit;
  int M;
  BIT(int M) : bit(vector<int>(M + 1, 0)), M(M) {}
  int sum(int i) {
    if (!i) return 0;
    return bit[i] + sum(i - (i & -i));
  }
  void add(int i, int x) {
    if (i > M) return;
    bit[i] += x;
    add(i + (i & -i), x);
  }
};
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vec<int> A(n);
  for (int i = 0; i < n; i++) cin >> A[i];
  vec<int> R(n);
  vec<pair<int, int>> p(n);
  for (int i = 0; i < n; i++) p[i] = {A[i], i};
  sort(p.begin(), p.end());
  for (int i = 0; i < n; i++) R[i] = p[i].second;
  int ans = 1 << 29;
  for (int i = 0; i < n; i++) {
    vec<int> left(n), right(n);
    for (int j = 0; j < n; j++) {
      if (A[j] < A[R[i]]) {
        left[j] = -1;
        continue;
      }
      if (j && left[j - 1] >= 0) {
        left[j] = left[j - 1];
      } else {
        left[j] = j;
      }
    }
    for (int j = 0; j < n; j++) {
      if (A[n - 1 - j] < A[R[i]]) {
        right[n - 1 - j] = -1;
        continue;
      }
      if (j && right[n - 1 - (j - 1)] >= 0) {
        right[n - 1 - j] = right[n - 1 - (j - 1)];
      } else {
        right[n - 1 - j] = n - 1 - j;
      }
    }
    BIT deleted(n);
    int ii = i - 1;
    for (int j = 0; j < q; j++) {
      ii++;
      while (ii < n &&
             !(right[R[ii]] + 1 - left[R[ii]] -
                   (deleted.sum(right[R[ii]] + 1) - deleted.sum(left[R[ii]])) >=
               k))
        ii++;
      if (ii == n) break;
      deleted.add(ii + 1, 1);
    }
    if (ii < n) {
      ans = min(ans, A[R[ii]] - A[R[i]]);
    }
  }
  cout << ans << endl;
  return 0;
}
