#include <bits/stdc++.h>
using namespace std;
long long N, A[2005], K, Q;
long long smin[2005];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> N >> K >> Q;
  for (long long i = 0, i_len = (N); i < i_len; ++i) cin >> A[i];
  long long ans = (3e15);
  for (long long mini = 0, mini_len = (N); mini < mini_len; ++mini) {
    vector<long long> v[N + 1];
    long long vi = 0;
    for (long long i = 0, i_len = (N); i < i_len; ++i) {
      if (A[i] < A[mini]) {
        vi++;
        continue;
      }
      v[vi].push_back(A[i]);
    }
    vector<long long> sv;
    for (long long i = 0, i_len = (vi + 1); i < i_len; ++i) {
      if (v[i].size() < K + Q - 1) continue;
      sort(v[i].begin(), v[i].end());
      for (long long j = 0, j_len = (Q); j < j_len; ++j) {
        sv.push_back(v[i][j]);
      }
    }
    if (sv.size() < Q) continue;
    sort(sv.begin(), sv.end());
    ans = min(ans, sv[Q - 1] - A[mini]);
  }
  cout << ans << endl;
  return 0;
}
