#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
int n, k, q, a[N], ans = 1e9 + 5, t[N], b[N], c[N];
void cal(int mn) {
  int l = 1, r = 1;
  b[0] = 0;
  while (l <= n) {
    c[0] = 0;
    while (a[l] < mn && l <= n) l++;
    r = l;
    while (a[r] >= mn && r <= n) r++;
    for (int i = l; i < r && i <= n; i++) c[++c[0]] = a[i];
    if (c[0] >= k) {
      for (int i = 1; i <= c[0] - k + 1; i++) b[++b[0]] = c[i];
    }
    l = r;
  }
  sort(b + 1, b + b[0] + 1);
  if (b[0] >= q) ans = min(ans, b[q] - b[1]);
}
int main() {
  scanf("%d%d%d", &n, &k, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    t[i] = a[i];
  }
  sort(t + 1, t + n + 1);
  for (int i = 1; i <= n; i++) cal(t[i]);
  printf("%d\n", ans);
  return 0;
}
