#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pll = pair<ll, ll>;
using vll = vector<ll>;
using vpll = vector<pll>;
using gr = vector<vll>;
using wgr = vector<vpll>;
struct d_ {
  template <typename T>
  d_& operator,(const T& x) {
    cerr << ' ' << x;
    return *this;
  }
  template <typename T>
  d_& operator,(const vector<T>& x) {
    for (auto x : x) cerr << ' ' << x;
    return *this;
  }
} d_t;
ll n, k, q;
ll a[2007];
ll solve(ll first) {
  vll second;
  for (ll i = 0; i < n;) {
    if (a[i] >= first) {
      vll v;
      while (i < n && a[i] >= first) {
        v.push_back(a[i]);
        i++;
      }
      if (v.size() <= k) continue;
      sort(begin(v), end(v));
      for (ll j(0); j < v.size() - k + 1; j++) second.push_back(v[j]);
    } else
      i++;
  }
  sort(begin(second), end(second));
  if (second.size() < q) return (1LL << 61);
  return second[q - 1] - first;
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin >> n >> k >> q;
  for (ll i(0); i < n; i++) cin >> a[i];
  ll ret = (1LL << 61);
  for (ll i(0); i < n; i++) ret = min(ret, solve(a[i]));
  cout << ret << endl;
  return 0;
}
