#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];
  set<long long> S;
  for (long long i = (long long)(0); i < (long long)(K); i++) S.insert(A[i]);
  vector<long long> B(N);
  for (long long i = (long long)(0); i < (long long)(K); i++) {
    long long X = *begin(S);
    B[i] = max(B[i], X);
  }
  for (long long i = (long long)(K); i < (long long)(N); i++) {
    S.erase(A[i - K]);
    S.insert(A[i]);
    long long X = *begin(S);
    for (long long j = (long long)(i - K + 1); j <= (long long)(i); j++)
      B[i] = max(B[i], X);
  }
  long long ans = (1ll << 60);
  for (long long i = (long long)(0); i < (long long)(N); i++) {
    vector<long long> C;
    for (long long j = (long long)(0); j < (long long)(N); j++) {
      if (A[i] <= A[j] && B[j] >= A[i]) C.push_back(A[j]);
    }
    if (C.size() >= Q) {
      sort((C).begin(), (C).end());
      ans = min(ans, C[Q - 1] - C[0]);
    }
  }
  cout << ans << endl;
}
