#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7, INF = 1e18;
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
signed main() {
  long long N, K, Q;
  cin >> N >> K >> Q;
  vector<long long> a(N + 1);
  for (long long i = 0; i < N; i++) {
    cin >> a[i];
  }
  a[N] = 0;
  long long ans = INF;
  for (long long i = 0; i < N + 1; i++) {
    long long ng = a[i];
    vector<long long> v;
    vector<long long> tmp;
    for (long long j = 0; j < N; j++) {
      if (a[j] <= ng) {
        if (tmp.size() >= K) {
          sort(tmp.begin(), tmp.end());
          for (long long k = 0; k < max(Q, (long long)tmp.size() - K + 1);
               k++) {
            if (tmp[k]) v.push_back(tmp[k]);
          }
        }
        tmp.clear();
      } else {
        tmp.push_back(a[j]);
      }
      if (j == N - 1) {
        if (tmp.size() < K) continue;
        sort(tmp.begin(), tmp.end());
        for (long long k = 0; k < min(Q, (long long)tmp.size() - K + 1); k++) {
          v.push_back(tmp[k]);
        }
        tmp.clear();
      }
    }
    sort(v.begin(), v.end());
    if ((long long)v.size() >= Q) {
      chmin(ans, v[Q - 1] - v[0]);
    }
  }
  cout << ans << endl;
}
