#include <bits/stdc++.h>
using namespace std;
const int MAX = 2000;
int main() {
  int N, K, Q, A[MAX];
  cin >> N >> K >> Q;
  int up[MAX];
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    up[i] = A[i];
  }
  sort(up, up + N);
  int ans = up[N - 1];
  int dat[MAX], dat2[MAX], tmp;
  for (int Y = 0; Y < N - Q; Y++) {
    tmp = 0;
    for (int l = 0, r = 0; r <= N; r++) {
      if (r >= N || A[r] < up[Y]) {
        for (int i = l; i < r; i++) dat2[i - l] = A[i];
        sort(dat2, dat2 + r - l);
        for (int i = 0; i < r - l - K + 1; i++) {
          dat[tmp] = dat2[i];
          tmp++;
        }
        l = r + 1;
      }
    }
    sort(dat, dat + tmp);
    cout << endl;
    if (tmp >= Q) ans = min(ans, dat[Q - 1] - dat[0]);
  }
  cout << ans;
  return 0;
}
