#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, K, Q;
  cin >> n >> K >> Q;
  vector<int> arr = vector<int>(n);
  vector<int> origin_arr = vector<int>(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  origin_arr = arr;
  sort(arr.begin(), arr.end());
  int result = 2100000000;
  for (int i = 0; i < n; i++) {
    int x = arr[i];
    vector<int> cur_interval;
    for (int j = 0; j < n; j++) {
      if (origin_arr[j] < x) cur_interval.push_back(j);
    }
    vector<int> candidates;
    for (int j = 0; j < cur_interval.size(); j++) {
      int st = (j == 0) ? 0 : cur_interval[j - 1] + 1;
      int end = (j == cur_interval.size() - 1) ? n : cur_interval[j + 1];
      for (int k = st; k <= end - K; k++) {
        candidates.push_back(arr[k]);
      }
    }
    if (candidates.size() >= Q) {
      sort(candidates.begin(), candidates.end());
      if (result > candidates[Q - 1] - candidates[0])
        result = candidates[Q - 1] - candidates[0];
    }
    cur_interval.clear();
    candidates.clear();
  }
  cout << result << endl;
}
