#include <bits/stdc++.h>
using namespace std;
int A[2000];
int N;
int K;
int Q;
pair<int, int> Ap[2000];
int B[2000];
int C[2000];
int D[2000];
int main() {
  scanf("%d%d%d", &N, &K, &Q);
  for (int i = 0; i < N; ++i) {
    scanf("%d", A + i);
    Ap[i] = pair<int, int>(A[i], i);
  }
  sort(Ap, Ap + N);
  int min = Ap[Q - 1].first - Ap[0].first;
  for (int p = 1; p < N - Q; ++p) {
    int t = 0;
    if (Ap[p].first == Ap[p - 1].first) continue;
    int last = 0;
    int num = 0;
    for (int i = 0; i < N; ++i) {
      B[i] = A[i];
      C[i] = 1;
    }
    for (int i = 0; i < p; ++i) {
      C[Ap[i].second] = 0;
    }
    for (int i = 0; i < N; ++i) {
      if (C[i]) continue;
      if (i - last < K) {
        last = i + 1;
        continue;
      }
      sort(B + last, B + i);
      for (int j = 0; j < i - last - K - 1; ++j) {
        D[num++] = B[last + j];
      }
      last = i + 1;
    }
    if (N - last >= K) {
      sort(B + last, B + N);
      for (int j = 0; j < N - last - K - 1; ++j) {
        D[num++] = B[last + j];
      }
    }
    if (num < Q) continue;
    sort(D, D + num);
    if (min > D[Q - 1] - D[0]) min = D[Q - 1] - D[0];
  }
  printf("%d", min);
  return 0;
}
