#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());
  int res = 1e+9;
  for (int i = 0; i < n; ++i) {
    int sum = 0;
    int cnt = 0;
    int piv = a[i];
    int x = 0;
    vector<int> v;
    vector<int> w;
    for (int j = 0; j < n; ++j) {
      if (i == j) continue;
      if (piv > a[j]) {
        int tmp = max(0, cnt - k + 1);
        sort(v.begin(), v.end());
        cnt = 0;
        for (int l = 0; l < tmp; ++l) w.push_back(v[l]);
        sum += tmp;
        v.clear();
      } else {
        v.push_back(a[j]);
        cnt++;
      }
    }
    int tmp = max(0, cnt - k + 1);
    sort(v.begin(), v.end());
    for (int l = 0; l < tmp; ++l) w.push_back(v[l]);
    sum += tmp;
    if (q - 1 <= sum) res = min(res, w[q - 2] - piv);
  }
  cout << res << "\n";
  return 0;
}
