#include <bits/stdc++.h>
using namespace std;
int n, k, q, a[2020];
priority_queue<int> q1, q2;
struct node {
  int v, id;
} b[2020];
inline bool cmp(node a, node b) { return a.v < b.v; }
void init() {
  scanf("%d%d%d", &n, &k, &q);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    b[i].v = a[i];
    b[i].id = i;
  }
  sort(b + 1, b + n + 1, cmp);
}
inline void extend(int l, int r) {
  if (l > r) return;
  int s = 0;
  while (r - l + 1 - s >= k) {
    int u = q1.top();
    q1.pop();
    q2.push(u);
    ++s;
  }
}
void solve() {
  int ans = 2e9;
  for (int t = 1; t <= n; ++t) {
    int la = 1;
    while (!q2.empty()) q2.pop();
    for (int i = 1; i <= n; ++i) {
      if (a[i]) q1.push(-a[i]);
      if (!a[i] || i == n) {
        if (i == n) ++i;
        extend(la, i - 1);
        la = i + 1;
        while (!q1.empty()) q1.pop();
      }
    }
    if (q2.size() < q) break;
    int mn = 2e9, mx = 0;
    for (int i = 1; i <= q; ++i) {
      int u = -q2.top();
      q2.pop();
      mn = min(mn, u), mx = max(mx, u);
    }
    ans = min(mx - mn, ans);
    a[b[t].id] = 0;
  }
  printf("%d\n", ans);
}
int main() {
  init();
  solve();
  return 0;
}
