#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;
ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0};
ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0};
const ll INF = 1LL << 50;
int main() {
  cout << fixed << setprecision(15);
  ll n, k, q;
  cin >> n >> k >> q;
  vll as(n);
  for (ll i = 0; i < (n); ++i) cin >> as[i];
  ll ans = INF;
  for (ll i = (k - 1); i <= (n - 1); ++i) {
    ll m = INF;
    for (ll j = (i - k + 1); j <= (i); ++j) m = min(m, as[j]);
    priority_queue<ll, vll, greater<ll>> pq;
    multiset<ll> cur;
    for (ll i = 0; i < (n); ++i) {
      if (as[i] >= m)
        cur.insert(as[i]);
      else {
        if ((ll)cur.size() >= k) {
          auto itr = cur.begin();
          for (ll _ = 0; _ < (k - (ll)cur.size() + 1); ++_) {
            pq.emplace(*itr);
            itr++;
          }
        }
        cur.clear();
      }
    }
    if ((ll)cur.size() >= k) {
      auto itr = cur.begin();
      for (ll _ = 0; _ < ((ll)cur.size() - k + 1); ++_) {
        pq.emplace(*itr);
        itr++;
      }
    }
    if ((ll)pq.size() >= q) {
      ll M = 0;
      for (ll _ = 0; _ < (q); ++_) {
        M = max(M, pq.top());
        pq.pop();
      }
      assert(M >= m);
      ans = min(ans, M - m);
    }
  }
  cout << ans << endl;
  return 0;
}
