#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  long a[n];
  set<long> mins;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mins.insert(a[i]);
  }
  long ans = 1e18;
  for (auto mi : mins) {
    vector<long> v;
    vector<long> t;
    for (int i = 0; i < n; i++) {
      if (a[i] < mi) {
        if (t.size() >= k + q - 1) {
          for (auto tt : t) v.push_back(tt);
        }
        t.clear();
      } else {
        t.push_back(a[i]);
      }
    }
    if (t.size() >= k + q - 1) {
      for (auto tt : t) v.push_back(tt);
    }
    if (v.size() == 0) continue;
    sort(v.begin(), v.end());
    ans = min(ans, v[q - 1] - mi);
  }
  cout << ans << endl;
  return 0;
}
