#include <bits/stdc++.h>
using namespace std;
template <class T>
void cmax(T &a, T b) {
  a = ((a) < (b) ? (b) : (a));
}
template <class T>
void cmin(T &a, T b) {
  a = ((a) < (b) ? (a) : (b));
}
template <class T>
void swp(T &a, T &b) {
  T temp = a;
  a = b;
  b = temp;
}
const long long maxn = 2100;
long long a[maxn], f[maxn], k, q, n;
long long cl(long long t) {
  long long no[maxn], b[maxn], len, temp;
  long long i;
  temp = 0;
  memset(no, 0, sizeof(no));
  for (i = (1); i <= (n); i++) {
    temp++;
    if (a[i] < f[t]) temp = 0;
    no[i] += temp;
  }
  temp = 0;
  for (i = n; i >= 1; i--) {
    temp++;
    if (a[i] < f[t]) temp = 0;
    no[i] += temp;
  }
  len = 0;
  long long res = 0;
  temp = 0;
  for (i = (1); i <= (n); i++)
    if (no[i] - 1 >= k) {
      temp++;
      if (temp == k) {
        long long j;
        for (j = (i - temp + 1); j <= (i); j++) b[++len] = a[j];
        res++;
      } else if (temp > k) {
        res++;
        b[++len] = a[i];
      }
    } else
      temp = 0;
  if (res < q) return INT_MAX >> 1;
  sort(b + 1, b + len + 1);
  return b[q] - b[1];
}
int main() {
  scanf("%lld%lld%lld", &n, &k, &q);
  long long i, ans = INT_MAX >> 1;
  for (i = (1); i <= (n); i++) scanf("%lld", &a[i]);
  for (i = (1); i <= (n); i++) f[i] = a[i];
  sort(f + 1, f + n + 1);
  for (i = (1); i <= (n); i++) cmin(ans, cl(i));
  printf("%lld", ans);
}
