#include <bits/stdc++.h>
using namespace std;
int bad[1000000] = {};
int main() {
  long long n, k, query;
  cin >> n >> k >> query;
  vector<long long> a;
  vector<pair<long long, long long>> hoge;
  for (long long i = 0; i < n; ++i) {
    long long b;
    cin >> b;
    a.push_back(b);
    hoge.push_back(make_pair(b, i));
  }
  sort(hoge.begin(), hoge.end());
  long long ans = 0;
  for (long long i = 0; i < n; ++i) {
    vector<long long> nyaw;
    vector<long long> going;
    for (long long q = 0; q < n; ++q) {
      if (bad[q] == 1) {
        if (nyaw.size() >= k) {
          sort(nyaw.begin(), nyaw.end());
          for (long long j = 0; j < nyaw.size() - k + 1; ++j) {
            going.push_back(nyaw[j]);
          }
        }
        if (nyaw.size() != 0) {
          nyaw.clear();
        }
      } else {
        nyaw.push_back(a[q]);
      }
    }
    sort(nyaw.begin(), nyaw.end());
    for (long long j = 0; j < nyaw.size() - k + 1; ++j) {
      going.push_back(nyaw[j]);
    }
    sort(going.begin(), going.end());
    if (going.size() < query) break;
    long long pre_ans = going[query - 1] - hoge[i].first;
    if (i == 0) ans = pre_ans;
    ans = min(pre_ans, ans);
    bad[hoge[i].second] = 1;
  }
  cout << ans << endl;
  return 0;
}
