#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, k, q;
  cin >> n >> k >> q;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long ans = 1 << 30;
  for (long long i = 0; i < n; i++) {
    vector<long long> v;
    for (long long j = 0; j < n; j++) {
      vector<long long> t;
      while (j < n && a[j] <= a[i]) {
        t.push_back(a[j]);
        j++;
      }
      sort(t.begin(), t.end());
      for (long long l = 0; l < max(0LL, (long long)t.size() - k + 1); l++) {
        v.push_back(t[l]);
      }
    }
    if (v.size() < q) continue;
    sort(v.begin(), v.end());
    ans = min(ans, v[q - 1] - v[0]);
  }
  cout << ans << endl;
  return 0;
}
