#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> sample_arr = vector<int>(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sample_arr = arr;
  sort(sample_arr.begin(), sample_arr.end());
  int result = sample_arr[Q - 1] - sample_arr[0];
  for (int i = 0; i < n; i++) {
    int x = arr[i];
    vector<int> cur_interval;
    for (int j = 0; j < n; j++) {
      if (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()) ? n : cur_interval[j];
      if (end - st >= Q) {
        priority_queue<int, vector<int>, greater<int> > temp;
        for (int k = st; k < end; k++) {
          temp.push(arr[k]);
        }
        for (int k = 0; k <= end - st + 1 - K; k++) {
          int top = temp.top();
          temp.pop();
          candidates.push_back(top);
        }
      }
    }
    candidates.push_back(x);
    if (candidates.size() >= Q) {
      sort(candidates.begin(), candidates.end());
      if (result > candidates[Q - 1] - candidates[0])
        result = candidates[Q - 1] - candidates[0];
    }
  }
  cout << result << endl;
}
