#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, q, a[2001], b[2001];
  cin >> n >> k >> q;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n - k + 1; i++) {
    int amin = int(1e9) + 1;
    for (int j = 0; j < k; j++) amin = min(amin, a[i + j]);
    b[i] = amin;
  }
  sort(a, a + n);
  int ans = a[q - 1] - a[0];
  for (int i = 0; i < n; i++) {
    vector<int> ls;
    for (int j = 0; j < n - k + 1; j++) {
      if (b[j] > a[i]) ls.push_back(b[j]);
    }
    if (ls.size() < q) break;
    sort(ls.begin(), ls.end());
    ans = min(ans, ls[q - 1] - ls[0]);
  }
  cout << ans << endl;
  return 0;
}
