#include <bits/stdc++.h>
using namespace std;
void copy(int *from, int *to, int N) {
  for (int i = 0; i < N; i++) {
    to[i] = from[i];
  }
}
int main() {
  int N, K, Q;
  int A[2000];
  int B[2000];
  int C[2000];
  int D[2000];
  int ans;
  cin >> N >> K >> Q;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    B[i] = A[i];
  }
  sort(B, B + N);
  ans = B[Q - 1] - B[0];
  int prev = 0;
  for (int i = 0; i < N; i++) {
    if (prev != B[i]) {
      int cnt = 0;
      int left = 0, right = 0;
      for (int j = 0; j < N; j++) {
        if (A[j] >= B[i])
          right++;
        else {
          if (right - left >= K) {
            copy(C, B + left, right - left);
            sort(C, C + right - left);
            copy(D + cnt, C, right - left - K + 1);
            cnt += right - left - K + 1;
          }
          left = j + 1;
          right = j + 1;
        }
      }
      if (cnt < Q)
        break;
      else
        ans = min(ans, D[Q - 1] - D[0]);
    }
    prev = B[i];
  }
  cout << ans << endl;
}
