#include <bits/stdc++.h>
using namespace std;
vector<int> clean(vector<int>& s, int k) {
  if (s.size() < k) {
    return vector<int>{};
  }
  vector<int> res;
  sort(s.begin(), s.end());
  for (int i = 0; i < int(s.size()) - k + 1; i++) {
    res.push_back(s[i]);
  }
  while (s.size()) s.pop_back();
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n), e;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  e = a;
  sort(a.begin(), a.end());
  int ans = INT_MAX;
  for (int i = 0; i < n; i++) {
    vector<int> s, v;
    for (int j = 0; j < n; j++) {
      if (a[j] < a[i]) {
        vector<int> p = clean(s, k);
        for (auto x : p) {
          v.push_back(x);
        }
      } else {
        s.push_back(a[j]);
      }
    }
    vector<int> p = clean(s, k);
    for (auto x : p) {
      v.push_back(x);
    }
    if (v.size() >= q) {
      sort(v.begin(), v.end());
      ans = min(ans, v[q - 1] - v[0]);
    }
  }
  cout << ans << endl;
}
