#include <bits/stdc++.h>
using namespace std;
const vector<long long> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<long long> dy = {1, 0, -1, 0, 1, -1, 1, -1};
constexpr long long MOD = (1000000007);
const long long INF = (1LL << 60);
const double EPS = (1 >> 30);
template <class tuple<long long, long long, long long>>
inline bool chmin(tuple<long long, long long, long long> &a,
                  tuple<long long, long long, long long> b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
} template <class tuple<long long, long long, long long>>
inline bool chmax(tuple<long long, long long, long long> &a,
                  tuple<long long, long long, long long> b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
} template <typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p) {
  is >> p.first >> p.second;
  return is;
}
long long nmax = 200000;
vector<vector<long long>> g(nmax);
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(15);
  long long n, k, q;
  cin >> n >> k >> q;
  vector<long long> a(n);
  for (long long i = 0; i < n; ++i) cin >> a[i];
  vector<long long> as = a;
  long long ans = INF;
  sort((as).begin(), (as).end());
  for (long long _ = 0; _ < n; ++_) {
    long long mi = as[_];
    vector<vector<long long>> b(n);
    long long idx = 0;
    multiset<long long> s;
    for (long long i = 0; i < n; ++i) {
      if (a[i] < mi) {
        if (b[idx].size() > 0) idx++;
      } else
        b[idx].push_back(a[i]);
    }
    idx++;
    for (long long i = 0; i < idx; ++i) {
      if (b[i].size() == 0) continue;
      sort((b[i]).begin(), (b[i]).end());
      for (long long j = 0; j < ((long long)b[i].size()) - k + 1; ++j) {
        s.insert(b[i][j]);
      }
    }
    auto it = s.begin();
    if (s.size() < q)
      continue;
    else {
      for (long long i = 0; i < q - 1; ++i) it++;
      chmin(ans, *it - mi);
    }
  }
  cout << ans << endl;
}
