#include <bits/stdc++.h>
using namespace std;
using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;
const double eps = 1e-10;
template <typename A, typename B>
inline void chmin(A &a, B b) {
  if (a > b) a = b;
}
template <typename A, typename B>
inline void chmax(A &a, B b) {
  if (a < b) a = b;
}
int32 N, K, Q;
vector<int64> A;
int main(void) {
  cin >> N >> K >> Q;
  A.resize(N);
  for (int i = 0; i < (N); i++) cin >> A[i];
  int64 res = (int64)1e18;
  for (int i = 0; i < (N); i++) {
    int64 tmp = A[i];
    A[i] = -1;
    priority_queue<int64, vector<int64>, greater<int64>> pq;
    int32 cnt = 0, cQ = 0, r = 0;
    int64 maxi = 0;
    vector<int64> v;
    for (int l = 0; l < (N); l++) {
      while (r < N) {
        if (A[r] == -1) {
          r++;
          continue;
        }
        if (A[r] < tmp) {
          pq = priority_queue<int64, vector<int64>, greater<int64>>();
          l = r;
          r++;
          break;
        } else {
          pq.push(A[r]);
          cnt++;
        }
        if (cnt >= K) {
          v.push_back(pq.top());
          pq.pop();
          cnt--;
          cQ++;
        }
        r++;
      }
    }
    sort(v.begin(), v.end());
    if (cQ + 1 >= Q) {
      res = min(res, v[Q - 2] - tmp);
    }
    A[i] = tmp;
  }
  cout << res << endl;
}
