#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
int main() {
  ll N, K, Q;
  cin >> N >> K >> Q;
  ll a[N];
  for (ll i = 0; i < N; i++) cin >> a[i];
  ll ans = 1145148931919180;
  for (ll i = 0; i < N; i++) {
    vector<ll> b;
    for (ll j = 0; j < N; j++)
      if (i != j) b.push_back(a[j]);
    vector<ll> v;
    v.push_back(-1);
    for (ll j = 0; j < N - 1; j++)
      if (b[j] < a[i]) v.push_back(j);
    v.push_back(N - 1);
    vector<ll> u;
    for (ll j = 0; j < v.size() - 1; j++) {
      vector<ll> tmp;
      for (ll k = v[j] + 1; k < v[j + 1]; k++) tmp.push_back(b[k]);
      sort(tmp.begin(), tmp.end());
      for (ll k = 0; tmp.size() - k >= K; k++) u.push_back(tmp[k]);
    }
    if (u.size() <= Q - 1) continue;
    sort(u.begin(), u.end());
    ans = min(ans, u[Q - 2] - a[i]);
  }
  cout << ans << endl;
  return 0;
}
