#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;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N, K, Q;
  cin >> N >> K >> Q;
  vector<long long> A(N);
  long long ans = 9223372036854775807;
  for (long long i = 0; i < N; i++) cin >> A[i];
  for (long long i = 0; i < N; i++) {
    long long X = A[i];
    vector<long long> tmp, fin;
    for (long long j = 0; j < N; j++) {
      if (A[j] >= X)
        tmp.push_back(A[j]);
      else {
        sort((tmp).begin(), (tmp).end());
        for (long long k = 0; k < tmp.size() - K + 1; k++)
          fin.push_back(tmp[k]);
        tmp.clear();
      }
    }
    sort((tmp).begin(), (tmp).end());
    for (long long k = 0; k < tmp.size() - K + 1; k++) fin.push_back(tmp[k]);
    sort((fin).begin(), (fin).end());
    if (Q - 1 < fin.size()) chmin(ans, fin[Q - 1] - fin[0]);
  }
  cout << ans << endl;
  return 0;
}
