#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  vector<int> b = a;
  sort(b.begin(), b.end());
  map<int, int> mp;
  for (int i = 0; i < n; ++i) {
    if (i == 0)
      mp[b[i]] = i;
    else if (b[i - 1] != b[i])
      mp[b[i]] = i;
  }
  int res = 1e+9;
  for (int i = 0; i < n; ++i) {
    int sum = 0;
    int cnt = 0;
    int piv = a[i];
    for (int j = 0; j < n; ++j) {
      if (i == j) continue;
      if (piv > a[j]) {
        sum += max(0, cnt - k + 1);
        cnt = 0;
      } else {
        cnt++;
      }
    }
    sum += max(0, cnt - k + 1);
    if (mp[a[i]] + q - 1 >= n) continue;
    if (q - 1 <= sum) res = min(res, b[mp[a[i]] + q - 1] - b[mp[a[i]]]);
  }
  cout << res << "\n";
  return 0;
}
