#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 (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
std::string printVector(const std::vector<T> &data) {
  std::stringstream ss;
  std::ostream_iterator<T> out_it(ss, ", ");
  ss << "[";
  std::copy(data.begin(), data.end() - 1, out_it);
  ss << data.back() << "]";
  return ss.str();
}
template <typename T>
void print_array(const T &ary, int size) {
  for (int i = (0); i < (size); ++i) {
    cout << ary[i] << " ";
  }
  cout << endl;
}
const int mod = 1e9 + 7;
const long long LINF = 1001002003004005006ll;
const int INF = 1001001001;
const double EPS = (1e-10);
const long double PI =
    3.14159265358979323846264338327950288419716939937510582097494459230781640628620899;
signed main(int argc, char const *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(12);
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(N);
  int ans = INF;
  for (int i = (0); i < (N); ++i) cin >> A[i];
  for (int i = (0); i < (N); ++i) {
    vector<vector<int> > array;
    vector<int> buff;
    for (int j = (0); j < (N); ++j) {
      if (A[j] >= A[i]) {
        buff.emplace_back(A[j]);
      } else {
        if (((int)(buff).size()) != 0) {
          array.emplace_back(buff);
          buff.clear();
        }
      }
    }
    if (((int)(buff).size()) != 0) {
      array.emplace_back(buff);
      buff.clear();
    }
    vector<int> cand;
    for (vector<int> x : array) {
      sort(x.begin(), x.end());
      int sz = ((int)(x).size());
      for (int j = (0); j < (sz - K + 1); ++j) {
        cand.emplace_back(x[j]);
      }
    }
    if (((int)(cand).size()) < Q) continue;
    chmin(ans, cand[Q - 1] - cand[0]);
  }
  cout << ans << endl;
}
