#include <bits/stdc++.h>
using namespace std;
int ans;
int n, k, q, a[2010], ls[2010];
priority_queue<int, vector<int>, greater<int> > q1, q2;
int main() {
  scanf("%d%d%d", &n, &k, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), ls[i] = a[i];
  sort(ls + 1, ls + n + 1);
  ans = ls[n] - ls[1];
  for (int p = 1; p <= n; p++) {
    for (int i = 1; i <= n; i++)
      if (a[i] >= ls[p]) {
        int j = i;
        while (j < n && a[j + 1] >= ls[p]) j++;
        if (j - i + 1 < k) {
          i = j;
          continue;
        }
        for (int x = i; x <= j; x++) q1.push(a[x]);
        for (int x = j - i + 1; x >= k; x--) q2.push(q1.top()), q1.pop();
        while (!q1.empty()) q1.pop();
        i = j;
      }
    int mx = 0;
    bool ok = true;
    for (int i = 1; i <= q; i++) {
      if (q2.empty()) {
        ok = false;
        break;
      }
      mx = q2.top(), q2.pop();
    }
    if (ok) ans = min(ans, mx - ls[p]);
  }
  printf("%d\n", ans);
  return 0;
}
