#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, int> memo;
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int p = 1; p <= q; p++) {
    for (int i = 0; i < n; i++) {
      if (memo[arr[i]] > 0) continue;
      int st = i;
      int count = 0;
      for (; st >= 0; st--) {
        if (arr[st] < arr[i] && memo[arr[st]] == 0) {
          break;
        }
        if (arr[st] >= arr[i]) count++;
      }
      if (st < 0) st++;
      int en = i;
      for (; en < n; en++) {
        if (arr[en] < arr[i] && memo[arr[en]] == 0) {
          break;
        }
        if (arr[en] >= arr[i]) count++;
      }
      if (count > k) {
        memo[arr[i]] = p;
      }
    }
  }
  sort(arr.begin(), arr.end());
  int result = 2100000000;
  for (int i = 0; i < n - q; i++) {
    if (memo[arr[i]] == 1) {
      bool possible = false;
      vector<int> flag = vector<int>(n, 0);
      flag[i] = 1;
      for (int p = 2; p <= q; p++) {
        possible = false;
        for (int j = i + 1; j < n; j++) {
          if (memo[arr[j]] == 0) continue;
          if (flag[j] == 0 && memo[arr[j]] <= p) {
            flag[j] = 1;
            possible = true;
            break;
          }
        }
        if (!possible) break;
      }
      if (possible) {
        if (result > arr[i + q - 1] - arr[i]) {
          result = arr[i + q - 1] - arr[i];
        }
      }
    }
  }
  cout << result << endl;
}
