#include <bits/stdc++.h>
using namespace std;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
const int INF = (((1 << 30) - 1) << 1) + 1;
const int nINF = 1 << 31;
const int N = 2000;
int n, k, q, a[N];
int rec(int l, int r) {
  if (r - l + 1 < q + k - 1) return INF;
  vector<int> v;
  int minidx = l;
  for (int i = (l); i <= (r); i++) {
    v.push_back(a[i]);
    if (a[i] < a[minidx]) minidx = i;
  }
  sort(v.begin(), v.end());
  int res = v[q - 1] - v[0];
  res = min(res, rec(l, minidx - 1));
  res = min(res, rec(minidx + 1, r));
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k >> q;
  for (int i = 0; i < (n); i++) cin >> a[i];
  int ans = rec(0, n - 1);
  cout << ans << endl;
  return 0;
}
