#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int N, K, Q, INF = 1000000007, ans = INF;
  cin >> N >> K >> Q;
  vector<int> A(N);
  for (int i = 0; i < N; i++) std::cin >> A[i];
  for (int i = 0; i < N; i++) {
    std::vector<multiset<int> > s(3000);
    vector<int> candi;
    int now = 0;
    for (int j = 0; j < N; j++) {
      if (A[j] >= A[i] && i != j)
        s[now].insert(A[j]);
      else if (s[now].size() != 0)
        now++;
    }
    for (int j = 0; j <= now; j++) {
      auto itr = s[j].begin();
      for (int k = 0; k < s[j].size() - K + 1; k++) {
        candi.push_back(*itr);
        itr++;
      }
    }
    sort(candi.begin(), candi.end());
    if (candi.size() < Q - 1) continue;
    ans = min(ans, candi[Q - 2] - A[i]);
  }
  std::cout << ans << '\n';
  return 0;
}
