#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 12;
const int inf = 0x7fffffff;
int a[N], n, k, q, ans = inf, b[N], c[N];
int solve(int w) {
  int l, r;
  c[0] = 0;
  for (int i = 1; i <= n; i = r + 1) {
    l = i;
    while (l <= n && a[l] < w) l++;
    r = l;
    while (r <= n && a[r] >= w) r++;
    r--;
    if (r - l + 1 < k) continue;
    b[0] = 0;
    for (int j = l; j <= r; j++) b[++b[0]] = a[j];
    sort(b + 1, b + b[0] + 1);
    for (int j = 1; j <= b[0] - k + 1; j++) c[++c[0]] = b[j];
  }
  if (c[0] < q) return inf;
  return c[q] - w;
}
int main() {
  scanf("%d %d %d", &n, &k, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) ans = min(ans, solve(a[i]));
  printf("%d\n", ans);
}
