#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 = 0; i < N; i++) {
    vector<long long> v;
    vector<long long> v1;
    long long left = 0;
    for (long long j = 0; j < N; j++) {
      if (B[i] > A[j]) {
        sort((v1).begin(), (v1).end());
        for (long long k = 0; k < v1.size() - K + 1; k++) {
          v.push_back(v1[k]);
        }
        v1.clear();
        left = j + 1;
      } else {
        v1.push_back(A[j]);
      }
    }
    sort((v1).begin(), (v1).end());
    for (long long k = 0; k < v1.size() - K + 1; k++) {
      v.push_back(v1[k]);
    }
    if (v.size() >= Q) {
      sort((v).begin(), (v).end());
      long long n = v[Q - 1] - v[0];
      min = (((min) < (n)) ? (min) : (n));
    }
  }
  cout << min << endl;
}
