#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
int n, K, q, a[N], Ha[N], hs, tax[N], b[N], c[N];
void Hash() {
  sort(Ha + 1, Ha + n + 1);
  hs = 1;
  for (int i = 2; i <= n; i++)
    if (Ha[i] != Ha[i - 1]) Ha[++hs] = Ha[i];
}
int find(int x) {
  int L = 1, R = hs, mid;
  while (L <= R) {
    mid = (L + R) >> 1;
    if (Ha[mid] == x) return mid;
    if (x > Ha[mid])
      L = mid + 1;
    else
      R = mid - 1;
  }
}
int main() {
  scanf("%d%d%d", &n, &K, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), Ha[i] = a[i];
  Hash();
  for (int i = 1; i <= n; i++) a[i] = find(a[i]);
  int ans = 1e9 + 7;
  for (int t = 0; t <= hs; t++) {
    int tot = 0;
    memset(tax, 0, sizeof tax);
    for (int i = 1, j; i <= n; i = j + 1) {
      if (a[i] <= t) {
        j++;
        continue;
      }
      for (j = i; j < n && a[j + 1] > t; j++)
        ;
      for (int k = i; k <= j; k++) b[k] = a[k];
      sort(b + i, b + j + 1);
      for (int k = i; j - k >= K - 1; k++) c[++tot] = b[k];
    }
    if (tot < q) continue;
    sort(c + 1, c + tot + 1);
    ans = min(ans, Ha[c[q]] - Ha[c[1]]);
  }
  printf("%d", ans);
  return 0;
}
