#include <bits/stdc++.h>
using namespace std;
const int maxN = 2010;
vector<int> lst, chosen;
int res, a[maxN], n, q, k;
void choose() {
  if (lst.size() >= k) {
    sort(lst.begin(), lst.end());
    for (int t = 0; t < lst.size() - k + 1; ++t) chosen.push_back(lst[t]);
  }
  lst.clear();
}
int main() {
  cin >> n >> k >> q;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  res = 1e9;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (a[j] < a[i])
        choose();
      else
        lst.push_back(a[j]);
    }
    choose();
    if (chosen.size() < q) continue;
    sort(chosen.begin(), chosen.end());
    res = min(res, chosen[q - 1] - chosen[0]);
    chosen.clear();
  }
  cout << res << endl;
}
