#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
template <class T>
using PQ = priority_queue<T>;
template <class T>
using PQG = priority_queue<T, vector<T>, greater<T> >;
const int INF = 100010001;
const ll LINF = (ll)INF * INF * 10;
template <typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {
  return a < b && (a = b, true);
}
template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {
  return a > b && (a = b, true);
}
template <typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p) {
  return is >> p.first >> p.second;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  return os << p.first << ' ' << p.second;
}
const int X = 2010;
int n, k, q;
int a[X];
map<int, vi> mp;
int ans = INF * 10;
set<P> se;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k >> q;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) mp[a[i]].emplace_back(i);
  se.emplace(0, n);
  for (auto &ne : mp) {
    bool ok = true;
    vi &v = ne.second;
    vi H;
    for (P p : se) {
      multiset<int> ss;
      for (int i = p.first; i < p.second; i++) ss.emplace(a[i]);
      while (ss.size() != k - 1) {
        H.emplace_back(*ss.begin());
        ss.erase(ss.begin());
      }
    }
    if (H.size() < q) break;
    sort(H.begin(), H.end());
    chmin(ans, H[q - 1] - H[0]);
    for (int i = 0; i < v.size(); ++i) {
      auto itr = se.lower_bound(P(v[i] + 1, 0));
      itr = prev(itr);
      P U = *itr;
      se.erase(itr);
      if (U.second - v[i] > k) se.emplace(v[i] + 1, U.second);
      if (v[i] - U.first >= k) se.emplace(U.first, v[i]);
    }
  }
  cout << ans << endl;
}
