#include <bits/stdc++.h>
using namespace std;
long long dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
long long dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
long long N, K, Q;
long long A[2200];
signed main() {
  cin >> N >> K >> Q;
  for (long long i = 0; i < N; i++) {
    cin >> A[i];
  }
  long long ans = 1145141919810LL;
  for (long long i = 0; i < N; i++) {
    vector<long long> vec;
    priority_queue<long long, vector<long long>, greater<long long> > pq;
    for (long long j = 0; j < N; j++) {
      if (A[j] < A[i]) {
        while (pq.size() >= K) {
          vec.push_back(pq.top());
          pq.pop();
        }
      } else {
        pq.push(A[j]);
      }
    }
    while (pq.size() >= K) {
      vec.push_back(pq.top());
      pq.pop();
    }
    sort(vec.begin(), vec.end());
    if (vec.size() < Q) continue;
    if (vec[0] != A[i]) continue;
    ans = min(ans, vec[Q - 1] - A[i]);
  }
  cout << ans << endl;
}
