#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];
  }
  long long min = LLONG_MAX;
  long long a = K + (Q - 1);
  for (long long i = 0; i <= N - a; i++) {
    for (long long j = 0; j < a; j++) {
      B[j] = A[i + j];
    }
    sort((B), (B) + (a));
    long long m = B[Q - 1] - B[0];
    if (min > m) {
      min = m;
    }
  }
  cout << min << endl;
}
