#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
int n, k, q, ans = 1e9, a[N], b[N], c[N];
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) {
    int cnt = 0;
    for (int j = 1; j <= n; ++j)
      if (a[j] >= a[i]) {
        int r = j;
        while (r < n && a[r + 1] >= a[i]) ++r;
        if (r - j + 1 >= k) {
          memcpy(b + j, a + j, (r - j + 1) << 2);
          sort(b + j, b + r + 1);
          for (int t = j; t <= r - k + 1; ++t) c[++cnt] = b[t];
        }
        j = r;
      }
    if (cnt >= q) ans = min(ans, c[q] - a[i]);
  }
  return printf("%d", ans), 0;
}
