#include <bits/stdc++.h>
int n, k, q;
int ans = 0x7fffffff;
int s[5005], c[5005], v[5005];
inline int Min(int a, int b) { return a < b ? a : b; }
inline void work(int x) {
  memset(c, sizeof(c), 0);
  memset(v, sizeof(v), 0);
  int l = 1, r = 1, cnt = 0;
  while (l <= n) {
    while (l <= n && s[l] < x) l++;
    r = l;
    while (r <= n && s[r] >= x) r++;
    r--;
    if (r - l + 1 >= k) {
      int tie = 0;
      for (int i = 1; i <= r; i++) v[++tie] = s[i];
      std::sort(v + 1, v + 1 + tie);
      tie = 1;
      for (int i = cnt + 1; tie <= r - l - k + 2; i++, tie++) c[i] = v[tie];
      cnt = cnt + r - l - k + 2;
    }
    l = ++r;
  }
  if (cnt >= q) {
    std::sort(c + 1, c + cnt + 1);
    if (c[1] == x) ans = Min(ans, c[q] - x);
  }
}
int main() {
  scanf("%d%d%d", &n, &k, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &s[i]);
  for (int i = 1; i <= n; i++) work(s[i]);
  printf("%d", ans);
}
