#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
vector<long long> W;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  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];
  vector<long long> b = a;
  sort(b.begin(), b.end());
  long long ans = b[q - 1] - b[0], pos = 0;
  while (pos + q - 1 < n) {
    vector<long long> v, w;
    v.push_back(b[pos]);
    long long sum = 0, cnt = 0, num = b[pos], tmp = 0;
    for (long long i = (0); i < (n); i++) {
      if (a[i] > num) {
        cnt++;
        w.push_back(a[i]);
      } else {
        sort(w.begin(), w.end());
        for (long long j = (0); j < (cnt - k + 1); j++) v.push_back(w[j]);
        w = W;
        sum += max(cnt - k + 1, 0LL);
        cnt = 0;
        if (a[i] == num) tmp++;
      }
    }
    sum += max(cnt - k + 1, 0LL);
    if (sum < q) break;
    sort(v.begin(), v.end());
    ans = min(ans, v[q - tmp] - num);
    pos += tmp;
  }
  cout << ans << endl;
}
