#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  using pi = pair<int, int>;
  vector<pi> b(n);
  for (int i = 0; i < n; ++i) b[i] = {a[i], i};
  sort(b.begin(), b.end());
  set<int> st;
  vector<int> idx;
  st.insert(n);
  int res = 1e+9;
  for (int i = 0; i < n; ++i) {
    int left = 0;
    vector<int> vec;
    for (auto val : st) {
      multiset<int> part;
      for (int j = left; j < val; ++j) {
        part.insert(a[j]);
      }
      if (part.empty()) continue;
      if ((int)part.size() - k < 0) continue;
      auto it = part.begin();
      for (int j = 0; j < part.size() - k + 1; ++j) {
        vec.push_back(*it);
        ++it;
      }
      left = val + 1;
    }
    if (vec.size() < q) break;
    sort(vec.begin(), vec.end());
    chmin(res, vec[q - 1] - vec[0]);
    idx.push_back(b[i].second);
    if (i == n - 1) continue;
    if (b[i].first != b[i + 1].first) {
      for (auto val : idx) {
        st.insert(val);
      }
    }
  }
  cout << res << "\n";
  return 0;
}
