#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long MAXN = 2e5 + 5;
const long long INF = 1e18;
const long double PI = acos((long double)-1);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k, q;
  cin >> n >> k >> q;
  vector<long long> values;
  set<long long> sorted;
  values.push_back(0);
  for (int i = (1); i <= (n); i++) {
    long long x;
    cin >> x;
    values.emplace_back(x);
    sorted.insert(x);
  }
  long long ans = INF;
  for (auto limit : sorted) {
    vector<long long> newvec, final;
    for (int i = (1); i <= (n); i++) {
      if (values[i] < limit) {
        sort(newvec.begin(), newvec.end());
        long long sz = (long long)(newvec.size()) - k;
        for (int i = (0); i <= (sz); i++) final.push_back(newvec[i]);
      } else
        newvec.push_back(values[i]);
    }
    sort(newvec.begin(), newvec.end());
    long long sz = (long long)(newvec.size()) - k;
    for (int i = (0); i <= (sz); i++) final.push_back(newvec[i]);
    sort(final.begin(), final.end());
    if (final.size() >= q) ans = min(ans, final[q - 1] - final[0]);
  }
  cout << ans;
}
