#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, k, q;
  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());
  long long ans = 1e18, pos = 0;
  while (1) {
    ans = min(ans, b[pos + q - 1] - b[pos]);
    vector<long long> v[2010];
    long long cnt = 0;
    for (long long i = (0); i < (n); i++) {
      if (i == pos)
        b[i] = -1e18;
      else if (a[i] >= b[pos])
        v[cnt].push_back(a[i]);
      else
        cnt++;
    }
    pos++;
    long long sum = 0;
    for (long long i = (0); i < (2010); i++)
      sum += max((long long)v[i].size() - k + 1, 0LL);
    if (sum < k) break;
  }
  cout << ans << endl;
}
