#include <bits/stdc++.h>
using namespace std;
struct edge {
  int from, to;
  long long cost;
};
const long long MOD = 1000000007;
int n, k, q;
int main() {
  std::ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k >> q;
  vector<long long> a(n + 1, 0LL);
  for (int i = 0; i < n; i++) cin >> a[i];
  long long ans = LLONG_MAX;
  for (int i = 0; i < n; i++) {
    long long min_ = a[i];
    long long max_ = 0LL;
    int cnt = 1;
    vector<long long> b;
    for (int j = 0; j < n + 1; j++) {
      if (i == j) continue;
      if (a[j] < min_) {
        int m = int(b.size());
        if (m < k) continue;
        cnt += min(m - k + 1, q - 1);
        sort(b.begin(), b.end());
        max_ = max(max_, b[min(m - k, q - 2)]);
      } else {
        b.push_back(a[j]);
      }
    }
    if (cnt >= q && max_) ans = min(ans, max_ - min_);
  }
  cout << ans << endl;
}
