#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int INF = 1000000009;
const long long INFL = 1000000000000000018ll;
int N, K, Q, a[2020], b[2020];
signed main() {
  cin >> N >> K >> Q;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  int ans = INF;
  sort(b, b + N);
  for (int i = 0; i < N; i++) {
    priority_queue<int, vector<int>, greater<int> > que, suzuki;
    for (int j = 0; j < N; j++) {
      if (b[i] <= a[j]) {
        que.push(a[j]);
      } else {
        while (que.size() >= K) {
          suzuki.push(que.top());
          que.pop();
        }
        while (que.size()) {
          que.pop();
        }
      }
    }
    while (que.size() >= K) {
      suzuki.push(que.top());
      que.pop();
    }
    if (suzuki.size() < Q) break;
    int mn = suzuki.top();
    int mx = 0;
    Q--;
    while (Q--) {
      suzuki.pop();
    }
    mx = suzuki.top();
    ans = min(ans, mx - mn);
  }
  cout << ans << endl;
  return 0;
}
