#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2000;
int arr[MAXN + 1], aux[MAXN + 1];
int ans;
inline bool check(int a, int b, int n, int k, int q) {
  int cnt = 0;
  int i = 1;
  vector<int> v;
  while (i <= n) {
    int j = i;
    while (j <= n && aux[a] <= arr[j] && arr[j] <= aux[b]) {
      v.push_back(arr[j]);
      j++;
    }
    cnt += max(0, j - i - k + 1);
    i = j + 1;
  }
  if (cnt < q) return 0;
  sort(v.begin(), v.end());
  ans = min(ans, v[q - 1] - v[0]);
  return 1;
}
int main() {
  int n, k, q, i;
  ios::sync_with_stdio(false);
  cin >> n >> k >> q;
  for (i = 1; i <= n; i++) {
    cin >> arr[i];
    aux[i] = arr[i];
  }
  sort(aux + 1, aux + n + 1);
  ans = 1e9;
  for (i = 1; i <= n; i++) {
    int res = i - 1;
    for (int step = 1 << 10; step; step >>= 1) {
      if (res + step <= n && check(i, res + step, n, k, q) == 0) {
        res += step;
      }
    }
    if (res < n) check(i, res + 1, n, k, q);
  }
  cout << ans;
  return 0;
}
