#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 2e3 + 3;
int A[N], B[N], n, k, q, i, j, ans;
bool f(int b, int e) {
  int i, j, k, las, t, x;
  las = t = x = 0;
  for (i = 1; i <= n + 1; i++) {
    if (A[i] < b) {
      x += max(0, min(t, i - las - k));
      las = i;
      t = 0;
    } else if (A[i] <= e)
      t++;
  }
  return x >= q;
}
int main() {
  cin >> n >> k >> q;
  for (i = 1; i <= n; i++) {
    cin >> A[i];
    B[i] = A[i];
  }
  sort(B + 1, B + n + 1);
  ans = mod;
  for (i = q, j = 1; i <= n; i++) {
    for (; j <= i && f(B[j], B[i]); j++)
      ;
    ans = min(ans, B[i] - B[j - 1]);
  }
  cout << ans;
  return 0;
}
