#include <bits/stdc++.h>
using namespace std;
const long long MOD = (long long)1e9 + 7;
const long long INF = (long long)1e18 * 5;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N, K, Q;
  cin >> N >> K >> Q;
  vector<long long> a(N);
  for (long long i = 0; i < (N); i++) cin >> a[i];
  long long ans = INF;
  for (long long i = 0; i < (N); i++) {
    long long X = a[i];
    vector<long long> rm;
    vector<long long> s(N);
    long long len = 0;
    for (long long j = 0; j < (N + 1); j++) {
      if (j == N || a[j] < X) {
        sort(s.begin(), s.begin() + len);
        for (long long k = 0; k < (len - K + 1); k++) {
          rm.push_back(s[k]);
        }
        len = 0;
      } else {
        s[len++] = a[j];
      }
    }
    if (rm.empty()) continue;
    sort((rm).begin(), (rm).end());
    ans = min(ans, rm[Q - 1] - X);
  }
  cout << ans << "\n";
  return 0;
}
