#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, q;
  cin >> n >> k >> q;
  vector<long long> ar;
  vector<pair<long long, long long>> vec;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    ar.push_back(a);
    vec.push_back(pair<long long, long long>(a, i));
  }
  ar.push_back(0);
  sort(vec.begin(), vec.end());
  long long border = 0, ans = 174417441744;
  for (int b = 0; b < n; b++) {
    vector<long long> kans;
    priority_queue<long long, vector<long long>, greater<long long>> pque;
    for (int i = 0; i <= n; i++) {
      if (ar[i] > border)
        pque.push(ar[i]);
      else {
        long long sz = max((long long)pque.size() - k + 1, (long long)0);
        for (int j = 0; j < sz; j++) {
          kans.push_back(pque.top());
          pque.pop();
        }
        while (!pque.empty()) pque.pop();
      }
    }
    sort(kans.begin(), kans.end());
    if (kans.size() < q)
      break;
    else
      ans = min(ans, kans[q - 1] - kans[0]);
  }
  cout << ans << endl;
}
