#include <bits/stdc++.h>
using namespace std;
const long long inf = 1000000007;
const long long MOD = 1000000007;
long long n, k, q;
long long calc(vector<long long> const& a, long long mn) {
  vector<long long> buf;
  vector<long long> hoge;
  for (long long i = 0; i < n + 1; ++i) {
    if (a[i] < mn) {
      sort(buf.begin(), buf.end());
      if (buf.size() >= k) {
        for (long long j = 0; j < buf.size() - k + 1; ++j) {
          hoge.push_back(buf[j]);
        }
      }
      buf.resize(0);
    } else {
      buf.push_back(a[i]);
    }
  }
  long long res = inf;
  sort(hoge.begin(), hoge.end());
  if (hoge.size() >= q) {
    res = hoge[q - 1] - hoge[0];
  }
  return res;
}
signed main() {
  cin >> n >> k >> q;
  vector<long long> a(n);
  for (long long i = 0; i < n; ++i) cin >> a[i];
  a.push_back(0);
  long long res = inf;
  vector<long long> num(a);
  sort(num.begin(), num.end());
  for (long long i = 0; i < q; ++i) {
    res = min(res, calc(a, num[i]));
  }
  cout << res << "\n";
  return 0;
}
