#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
template <class T>
inline void chmax(T &a, const T &b) {
  if ((a) < (b)) (a) = (b);
}
template <class T>
inline void chmin(T &a, const T &b) {
  if ((a) > (b)) (a) = (b);
}
template <typename T>
using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast {
  Fast() {
    std::cin.tie(0);
    ios::sync_with_stdio(false);
  }
} fast;
signed main() {
  long long n, k, q;
  cin >> n >> k >> q;
  vector<long long> a(n);
  set<long long> v;
  for (long long i = (long long)(0); i < (long long)(n); ++i) {
    cin >> a[i];
    v.insert(a[i]);
  }
  42;
  long long left = -1;
  long long right = 1e9;
  auto isright = [&](long long d) {
    42;
    long long res = INF;
    for (auto &&x : v) {
      vector<long long> b(a);
      vector<long long> tmp, box;
      for (long long i = (long long)(0); i < (long long)(n); ++i) {
        if (b[i] < x) {
          if (((long long)(tmp).size()) < k) continue;
          sort((tmp).begin(), (tmp).end());
          for (long long i = (long long)(0);
               i < (long long)(((long long)(tmp).size()) - (k - 1)); ++i)
            box.push_back(tmp[i]);
          tmp = vector<long long>();
        } else {
          tmp.push_back(b[i]);
        }
      }
      if (((long long)(tmp).size()) >= k) {
        sort((tmp).begin(), (tmp).end());
        for (long long i = (long long)(0);
             i < (long long)(((long long)(tmp).size()) - (k - 1)); ++i)
          box.push_back(tmp[i]);
      }
      sort((box).begin(), (box).end());
      42;
      if (((long long)(box).size()) >= q) {
        chmin(res, box[q - 1] - box[0]);
      }
    }
    bool ans = (res <= d ? true : false);
    42;
    return ans;
  };
  while (right - left > 1) {
    long long mid = (right + left) / 2;
    if (isright(mid)) {
      right = mid;
    } else {
      left = mid;
    }
  }
  42;
  cout << right << endl;
  return 0;
}
