#include <bits/stdc++.h>
using namespace std;
long long n, k, q;
long long a[2002];
const long long inf = 1e12;
bool take[2002];
long long solve(long long x) {
  for (long long i = 1; i <= n; i++) {
    if (a[i] < x)
      take[i] = false;
    else
      take[i] = true;
  }
  vector<long long> t;
  for (long long i = 1; i <= n; i++) {
    if (take[i] == false) continue;
    long long j = i;
    while (j <= n && take[j] == true) j++;
    vector<long long> v;
    for (long long p = i; p < j; p++) v.push_back(a[p]);
    long long sz = v.size();
    if (sz - k + 1 <= 0) continue;
    sort(v.begin(), v.end());
    for (long long p = 0; p < sz - k + 1; p++) t.push_back(v[p]);
    i = j - 1;
  }
  sort(t.begin(), t.end());
  if (t.size() < q) return inf;
  return t[q - 1] - t[0];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k >> q;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long ans = inf;
  for (long long i = 1; i <= n; i++) {
    ans = min(ans, solve(a[i]));
  }
  cout << ans << endl;
  return 0;
}
