#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2000;
int n, k, q, A[MAXN + 5];
int SOLVE(int x) {
  int pri[MAXN + 5] = {};
  for (int i = 0; i < n; i++) {
    while (i < n && A[i] < x) i++;
    int que[MAXN + 5] = {};
    while (i < n && A[i] >= x) que[++que[0]] = A[i];
    if (que[0] >= k) {
      sort(que + 1, que + que[0] + 1);
      int cnt = 0, len = que[0];
      for (int i = 1; i <= len - k - 1 && i <= que[0]; i++)
        pri[++pri[0]] = que[i];
    }
  }
  if (pri[0] < q) return 1e9 + 5;
  sort(pri + 1, pri + pri[0] + 1);
  return pri[q] - pri[1];
}
int main() {
  scanf("%d%d%d", &n, &k, &q);
  for (int i = 0; i < n; i++) scanf("%d", &A[i]);
  int ans = 1e9 + 5;
  for (int i = 0; i < n; i++) ans = min(ans, SOLVE(A[i]));
  printf("%d\n", ans);
  return 0;
}
