#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& a) {
  return os << "(" << a.first << "," << a.second << ")";
}
template <class T>
void pv(T a, T b) {
  for (T i = a; i != b; ++i) cout << (*i) << " ";
  cout << endl;
}
template <class T>
void chmin(T& a, const T& b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T& a, const T& b) {
  if (a < b) a = b;
}
int nextInt() {
  int x;
  scanf("%d", &x);
  return x;
}
long long nextLong() {
  long long x;
  scanf("%lld", &x);
  return x;
}
const int MAX_N = 2010;
int A[MAX_N];
int cannot[MAX_N];
int main2() {
  int N = nextInt();
  int K = nextInt();
  int Q = nextInt();
  for (int i = 0, _n = (int)(N); i < _n; ++i) A[i] = nextInt();
  int ans = 1001001001;
  for (int yi = 0, _n = (int)(N); yi < _n; ++yi) {
    memset(cannot, (0), sizeof(cannot));
    int Y = A[yi];
    for (int i = 0; i < N; i++) {
      if (A[i] < Y) {
        int l = i - K + 1;
        int r = i + K;
        cannot[max(l, 0)] = 1;
        cannot[min(r, N)] = -1;
      }
    }
    for (int i = 0; i < N; i++) cannot[i + 1] += cannot[i];
    vector<int> use;
    for (int i = 0; i < N; i++) {
      if (!cannot[i]) {
        use.push_back(A[i]);
      }
    }
    sort((use).begin(), (use).end());
    if ((int)use.size() >= Q) {
      chmin(ans, use[Q - 1] - use[0]);
    }
  }
  cout << ans << endl;
  return 0;
}
int main() {
  main2();
  return 0;
}
