#include <bits/stdc++.h>
using namespace std;
int N, K, Q;
int A[2001];
int sorted_A[2001];
int get_max(int a) {
  priority_queue<int, vector<int>, greater<int> > que1;
  priority_queue<int, vector<int>, greater<int> > que;
  for (int j = 0; j < N; j++) {
    if (A[j] >= a) {
      que.push(A[j]);
      continue;
    }
    while (que.size() >= K) {
      que1.push(que.top());
      que.pop();
    }
    que = priority_queue<int, vector<int>, greater<int> >();
  }
  while (que.size() >= K) {
    que1.push(que.top());
    que.pop();
  }
  printf("que1.size(): %d, Q: %d\n", (int)que1.size(), Q);
  if (que1.size() >= Q) {
    for (int i = 1; i < Q; i++) {
      que1.pop();
    }
    return que1.top();
  } else {
    return -1;
  }
}
int main() {
  cin >> N >> K >> Q;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    sorted_A[i] = A[i];
  }
  sort(sorted_A, sorted_A + N);
  int ans = 1e9;
  for (int i = 0; i < N; i++) {
    int a = sorted_A[i];
    int M = get_max(a);
    if (M != -1) {
      ans = min(ans, M - a);
    }
  }
  cout << ans << endl;
  return 0;
}
