#include <bits/stdc++.h>
using namespace std;
long long N, K, Q;
long long A[2010];
long long B[2010];
signed main() {
  cin >> N >> K >> Q;
  for (long long(i) = 0; (i) < (N); (i)++) {
    cin >> A[i];
    B[i] = A[i];
  }
  sort((B), (B) + (N));
  long long min = B[Q - 1] - B[0];
  for (long long i = 1; i < N - (Q - 1); i++) {
    long long a = B[i];
    long long b = B[i + Q - 1];
    long long n = b - a;
    long long err_cnt = 0;
    long long range_cnt = 0;
    long long cnt = 0;
    for (long long j = 0; j < K; j++) {
      if (a > A[j]) {
        err_cnt++;
      }
      if (b >= A[j] && A[j] >= a) {
        range_cnt++;
      }
    }
    if (err_cnt == 0 && range_cnt > 0) {
      cnt++;
    }
    for (long long j = K; j < N; j++) {
      if (a > A[j - K]) {
        err_cnt--;
      }
      if (b >= A[j - K] && A[j - K] >= a) {
        range_cnt--;
      }
      if (a > A[j]) {
        err_cnt++;
      }
      if (b >= A[j] && A[j] >= a) {
        range_cnt++;
      }
      if (err_cnt == 0 && range_cnt > 0) {
        cnt++;
      }
    }
    if (cnt >= Q) {
      min = (((n) < (min)) ? (n) : (min));
    }
  }
  cout << min << endl;
}
