#include <bits/stdc++.h>
using namespace std;
int n, k, q, mn = 1e9, a[2005], v[2005];
pair<int, int> b[2005];
vector<int> t;
int main() {
  int i, j, x, l, r;
  cin >> n >> k >> q;
  for (i = 1; i <= n; i++) cin >> a[i], b[i] = {a[i], i};
  sort(b + 1, b + n + 1);
  v[0] = v[n + 1] = 1;
  for (i = 1; i < n; i++) {
    t.clear();
    x = b[i].second;
    for (l = x; !v[l]; l--)
      ;
    for (r = x; !v[r]; r++)
      ;
    v[x] = 1;
    if (r - l < k + q) continue;
    for (j = l + 1; j < r; j++) t.push_back(b[j].first);
    sort(t.begin(), t.end());
    mn = min(mn, t[q - 1] - t[0]);
  }
  cout << mn;
  return 0;
}
