#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> arr = vector<int>(n);
  unordered_map<int, bool> memo;
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < n; i++) {
    int j = 0;
    if (i - k + 1 > 0) j = i - k + 1;
    bool possible = true;
    for (; j < i; j++) {
      if (arr[j] < arr[i]) {
        possible = false;
        break;
      }
    }
    for (int j = i + 1; j < i + k; j++) {
      if (arr[j] < arr[i]) {
        possible = false;
        break;
      }
    }
    memo[arr[i]] = possible;
  }
  sort(arr.begin(), arr.end());
  int result = 2100000000;
  for (int i = 0; i < n - q; i++) {
    if (memo[arr[i]] && result > arr[i + q - 1] - arr[i])
      result = arr[i + q - 1] - arr[i];
  }
  cout << result << endl;
}
