#include <bits/stdc++.h>
using namespace std;
const int inf = INT_MAX;
int n, k, q;
int A[2005], sorted_A[2005], temp[2005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k >> q;
  int ans = inf;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    sorted_A[i] = A[i];
  }
  sort(sorted_A, sorted_A + n);
  for (int i = 0; i < n; i++) {
    int begin = 0, end = 0;
    temp[0] = 0;
    while (begin <= end) {
      while (A[begin] < sorted_A[i] && begin < n) {
        begin++;
      }
      end = begin;
      while (A[end] >= sorted_A[i] && end < n) {
        end++;
      }
      if (end - begin >= k) {
        int *tmp = new int[end - begin + 1];
        for (int j = 0; j < end - begin; j++) tmp[j] = A[begin + j];
        sort(tmp, tmp + end - begin);
        for (int j = 0; j < k; j++) temp[++temp[0]] = tmp[j];
        delete[] tmp;
      }
      begin = end;
      if (end == n) break;
    }
    if (temp[0] >= q) {
      sort(temp + 1, temp + 1 + temp[0]);
      ans = min(ans, temp[q] - sorted_A[i]);
    }
  }
  cout << ans << endl;
  return 0;
}
