#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, k, q;
  cin >> n >> k >> q;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  vector<pair<long long, long long> > srt;
  for (long long i = 0; i < n; i++) srt.push_back(make_pair(v[i], i));
  sort(srt.begin(), srt.end());
  long long ans = 1e18, vl;
  for (long long i = 0; i <= n; i++) {
    if (i == 0)
      vl = -1;
    else
      vl = srt[i - 1].first;
    vector<long long> block;
    for (long long j = 0; j < i; j++) block.push_back(srt[j].second);
    block.push_back(-1);
    block.push_back(n);
    sort(block.begin(), block.end());
    vector<long long> abl;
    for (long long j = 0; j < block.size() - 1; j++) {
      vector<long long> best;
      for (long long p = block[j] + 1; p <= block[j + 1] - 1; p++)
        best.push_back(v[p]);
      sort(best.begin(), best.end(), greater<long long>());
      while (best.size() >= k || (best.size() && best.back() == vl)) {
        abl.push_back(best.back());
        best.pop_back();
      }
    }
    sort(abl.begin(), abl.end());
    if (abl.size() < q) continue;
    ans = min(ans, abl[q - 1] - abl[0]);
  }
  cout << ans;
}
