#include <bits/stdc++.h>
using namespace std;
int n, k, Q, a[100009];
int sol(int X) {
  priority_queue<int, vector<int>, greater<int> > q, ANS;
  for (int i = 0; i < n; i++) {
    if (a[i] == X) {
    L:;
      while (q.size() >= k) ANS.push(q.top()), q.pop();
      while (!q.empty()) q.pop();
    } else
      q.push(a[i]);
    if (q.size() && i == n - 1) goto L;
  }
  if (ANS.size() < Q) return 1e9;
  int MIN = ANS.top(), cnt = 1;
  while (cnt++ != Q) ANS.pop();
  return ANS.top() - MIN;
}
int main() {
  cin >> n >> k >> Q;
  for (int i = 0; i < n; i++) cin >> a[i];
  int ans = 1e9;
  for (int i = 0; i < n; i++) ans = min(ans, sol(a[i]));
  ans = min(ans, sol(0));
  cout << ans << endl;
}
