#include <bits/stdc++.h>
using namespace std;
unsigned long long over = 1000000007;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed;
  int n, k, q;
  cin >> n >> k >> q;
  unsigned long long a[n];
  vector<tuple<unsigned long long, int> > s;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    s.push_back(make_tuple(a[i], i));
  }
  sort(s.begin(), s.end());
  unsigned long long best = get<0>(s[n - 1]) - get<0>(s[0]);
  for (int i = 0; i < n; ++i) {
    vector<bool> v(n, false);
    for (int j = 0; j < i; ++j) {
      v[get<1>(s[j])] = true;
    }
    vector<unsigned long long> buff;
    vector<unsigned long long> capable;
    for (int j = 0; j < n; ++j) {
      if (v[j] == false) {
        buff.push_back(a[j]);
      } else {
        sort(buff.begin(), buff.end());
        for (int l = 0; buff.size() - l >= k; ++l) capable.push_back(buff[l]);
        buff.clear();
      }
    }
    sort(buff.begin(), buff.end());
    for (int l = 0; buff.size() - l >= k; ++l) capable.push_back(buff[l]);
    buff.clear();
    sort(capable.begin(), capable.end());
    for (int j = 0; j + q - 1 < capable.size(); ++j) {
      best = min(best, capable[j + q - 1] - capable[j]);
    }
  }
  cout << best << endl;
  return 0;
}
