#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int infi = 2147483600;
const long long infl = 1e17;
int main() {
  long long n, k, q;
  cin >> n >> k >> q;
  vector<long long> a(n);
  for (long long i = 0; i < (long long)n; i++) cin >> a[i];
  vector<long long> b(n);
  copy((a).begin(), (a).end(), b.begin());
  sort((b).begin(), (b).end());
  long long ans = infl;
  for (long long s = 0; s < (long long)n - q + 2; s++) {
    long long cnt = 0;
    long long res = 0;
    for (long long i = 0; i < (long long)n; i++) {
      if (a[i] >= b[s])
        cnt++;
      else {
        res += max(0ll, cnt - k + 1);
        cnt = 0;
      }
    }
    res += max(0ll, cnt - k + 1);
    if (res >= q) {
      ans = min(ans, b[s + q - 1] - b[s]);
    }
  }
  cout << ans << endl;
}
