#include <bits/stdc++.h>
using namespace std;
int64_t mod = 1e9 + 7;
int64_t INF = 1e18;
double EPS = 0.00000001;
int main() {
  int64_t n, k, q;
  cin >> n >> k >> q;
  vector<int64_t> a(n);
  for (int64_t i = 0; i < n; i++) cin >> a[i];
  vector<int64_t> b = a;
  sort(b.begin(), b.end());
  int64_t mi = b[q - 1] - b[0];
  vector<bool> use(n, true);
  for (int64_t i = 0; i <= n - q; i++) {
    use[i] = false;
    vector<int64_t> v;
    int64_t j = 0;
    while (j < n - i) {
      vector<int64_t> vx;
      while (use[j] && j < n - i) {
        vx.emplace_back(a[j]);
        j++;
      }
      if ((int64_t)vx.size() >= n) {
        sort(vx.begin(), vx.end());
        for (int64_t k = 0; k <= (int64_t)vx.size() - n; k++) {
          v.emplace_back(vx[k]);
        }
      }
      j++;
    }
    if ((int64_t)v.size() < q) {
      break;
    } else {
      mi = min(mi, v[q - 1] - v[0]);
    }
  }
  cout << (mi) << endl;
  return 0;
}
