#include <bits/stdc++.h>
using namespace std;
long long n, k, q, s[2000], ans = 1e15, N;
vector<long long> v, vv;
int main(void) {
  cin >> n >> k >> q;
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      if (s[i] <= s[j]) {
        v.push_back(s[j]);
      } else {
        N = v.size();
        if (N - k + 1 > 0) {
          sort(v.begin(), v.end());
          for (int ii = 0; ii < N - k + 1; ii++) vv.push_back(v[ii]);
        }
        v = {};
      }
    }
    N = v.size();
    if (N - k + 1 > 0) {
      sort(v.begin(), v.end());
      for (int ii = 0; ii < N - k + 1; ii++) vv.push_back(v[ii]);
    }
    v = {};
    if (vv.size() >= q - 1) {
      sort(vv.begin(), vv.end());
      ans = min(ans, vv[q - 2] - s[i]);
      vv = {};
    }
  }
  cout << ans << endl;
}
