#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  vector<int> copy(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    copy[i] = a[i];
  }
  sort(copy.begin(), copy.end());
  int ans = (1e9);
  for (int i = 0; i < (n - k + 1); i++) {
    bool checker = false;
    vector<int> clear;
    for (int j = 0; j < n; j++) {
      if (checker == true) {
        if ((j + k - 1) >= n) {
          clear.push_back(a[j]);
          continue;
        }
        if (a[j + k - 1] < copy[i]) {
          checker = false;
          j = j + k - 1 + k - 1;
          continue;
        } else {
          clear.push_back(a[j]);
          continue;
        }
      }
      bool checker2 = true;
      for (int l = j - k + 1; l <= j + k - 1; l++) {
        if (l < 0) {
          continue;
        }
        if (l >= n) {
          continue;
        }
        if (a[l] < copy[i]) {
          checker2 = false;
          j = l + k - 1;
          break;
        }
      }
      if (checker2 == true) {
        clear.push_back(a[j]);
        checker = true;
      }
    }
    if (clear.size() < q) {
      break;
    }
    sort(clear.begin(), clear.end());
    ans = min(ans, clear[q - 1] - clear[0]);
  }
  cout << ans << endl;
  return 0;
}
