#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using db = long double;
using ii = pair<int, int>;
const int N = 1e5 + 5, LG = 19, MOD = 998244353;
const int SQ = 320;
const long double EPS = 1e-7;
int n, k, q;
int a[2005];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k >> q;
  vector<int> v;
  for (int i = 0; i < n; i++) cin >> a[i], v.push_back(a[i]);
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
  reverse(v.begin(), v.end());
  int ans = INT_MAX;
  for (auto x : v) {
    vector<int> v;
    for (int i = 0, j = 0; i < n; i = j) {
      if (a[i] < x)
        j = i + 1;
      else {
        vector<int> vx;
        for (; j < n && a[j] >= x; j++) {
          vx.push_back(a[j]);
        }
        sort(vx.begin(), vx.end());
        for (int ii = 0; ii < (int)vx.size() - k + 1; ii++) v.push_back(vx[ii]);
      }
    }
    if (v.size() < q) continue;
    sort(v.begin(), v.end());
    for (int j = q - 1; j < v.size(); j++) {
      ans = min(ans, v[j] - v[j - q + 1]);
    }
  }
  cout << ans << '\n';
  return 0;
}
