#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e15;
vector<vector<long long> > split_vector(vector<long long> &a, long long pivot) {
  vector<vector<long long> > res;
  a.push_back(pivot - 1);
  for (long long i = 0; i < a.size(); i++) {
    vector<long long> tmp;
    while (i < a.size() && a[i] >= pivot) {
      tmp.push_back(a[i++]);
    }
    if (tmp.size() != 0) res.push_back(tmp);
  }
  a.pop_back();
  return res;
}
signed main() {
  long long n, k, q, ans = INF;
  cin >> n >> k >> q;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<long long> b = a;
  sort(b.begin(), b.end());
  for (long long i = 0; i < n - q; i++) {
    vector<vector<long long> > d = split_vector(a, b[i]);
    vector<long long> c;
    for (long long j = 0; j < d.size(); j++) {
      sort(d[j].begin(), d[j].end());
      for (long long l = 0; l < (long long)d[j].size() - k + 1; l++) {
        c.push_back(d[j][l]);
      }
    }
    if (c.size() >= q) {
      sort(c.begin(), c.end());
      ans = min(ans, c[q - 1] - c[0]);
    }
  }
  cout << ans << endl;
}
