#include <bits/stdc++.h>
using namespace std;
priority_queue<int, deque<int>, greater<int> > h;
priority_queue<int, deque<int>, greater<int> > t;
int v[2333];
int a[2333];
int n, k, q;
int maxa;
int res;
int main() {
  int i, j;
  int x;
  res = 2147483647;
  scanf("%d%d%d", &n, &k, &q);
  for (i = 1; i <= n; i++) scanf("%d", a + i), maxa = max(maxa, a[i]);
  for (x = 1; x <= maxa; x++) {
    int m = 0;
    for (i = 1; i <= n; i++)
      if (a[i] < x) v[++m] = i;
    if (m == 0) {
      for (i = 1; i <= n; i++) t.push(a[i]);
      for (i = 1; i < q; i++) t.pop();
      res = min(res, t.top() - x);
      continue;
    }
    for (i = 1; i <= m; i++) {
      if (v[i] - v[i - 1] - 1 < k) continue;
      for (j = v[i - 1] + 1; j <= v[i]; j++) t.push(a[j]);
      int tmp = v[i] - v[i - 1] - k;
      for (j = 1; j <= tmp; j++) h.push(t.top()), t.pop();
      while (!t.empty()) t.pop();
    }
    for (i = 1; i < q; i++) h.pop();
    res = min(res, h.top() - x);
  }
  printf("%d\n", res);
  return 0;
}
