#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N, K, Q;
  cin >> N >> K >> Q;
  vector<long long> A(N);
  for (long long i = (long long)(0); i < (long long)(N); i++) cin >> A[i];
  long long ans = (1ll << 62) - 1;
  for (long long i = (long long)(0); i < (long long)(N); i++) {
    priority_queue<long long, vector<long long>, greater<long long>> que, queu;
    for (long long j = (long long)(0); j < (long long)(N); j++) {
      if (A[j] < A[i]) {
        for (long long k = (long long)(0);
             k <= (long long)((long long)que.size() - K); k++) {
          queu.push(que.top());
          que.pop();
        }
        while (que.size() > 0) que.pop();
      } else
        que.push(A[j]);
    }
    long long P = que.size();
    for (long long k = (long long)(0); k <= (long long)(P - K); k++) {
      queu.push(que.top());
      que.pop();
    }
    if ((long long)queu.size() >= Q) {
      long long X = 0, Y = A[i];
      for (long long j = (long long)(0); j < (long long)(Q); j++) {
        X = max(queu.top(), X);
        queu.pop();
      }
      ans = min(ans, X - Y);
    }
  }
  cout << ans << endl;
}
