#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
long long int n, k, q, a[2300], b[5000], res, sum[2300] = {}, key = 0;
queue<pair<long long, long long> > que;
int main() {
  const long long int INF = 99999999999999;
  map<long long int, long long int> mp;
  string str[550], red[550], blue[550];
  priority_queue<long long int> pq[4];
  priority_queue<long long int> tmp[4];
  cout << fixed << setprecision(10);
  cin >> n >> k >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b + n);
  for (int i = n; i <= 4500; i++) {
    b[i] = INF;
  }
  res = b[q - 1] - b[0];
  long long int now = -1, need = 0;
  for (int i = 1; i <= n - q; i++) {
    need = 0;
    key = 0;
    now = -1;
    for (int j = 0; j < n; j++) {
      if (a[j] < b[i]) {
        if ((j - 1 - now) - k + 1 < need && need != 0) {
          key = 1;
          break;
        } else {
          now = j;
          need = 0;
        }
      } else if (a[j] <= b[i + q - 1]) {
        need++;
      }
    }
    if (n - now - k < need && need != 0 || key == 1) {
    } else {
      res = min(res, b[i + q - 1] - b[i]);
    }
  }
next:
  cout << res << endl;
}
