#include <bits/stdc++.h>
long long int INF = 1000000000000000000LL;
using namespace std;
long long int A[2100] = {};
int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  bool flag[2100] = {};
  for (int i = 0; i <= N - K; i++) {
    int ind = 0;
    long long int mini = INF;
    for (int j = 0; j < K; j++) {
      if (mini > A[i + j]) {
        mini = A[i + j];
        ind = i + j;
      }
    }
    flag[ind] = true;
  }
  vector<long long int> v;
  for (int i = 0; i < N; i++) {
    if (flag[i]) {
      v.push_back(A[i]);
    }
  }
  sort(v.begin(), v.end());
  sort(A, A + N);
  if (v.size() >= Q) {
    long long int ans = INF;
    for (int i = 0; i < v.size() - Q + 1; i++) {
      ans = min(ans, v[i + Q - 1] - v[i]);
    }
    cout << ans << endl;
  } else {
    cout << A[Q - 1] - A[0] << endl;
  }
  return 0;
}
