#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long N, K, Q;
long long A[2001];
const long long inf = 0xffffffffffffff;
long long ans = inf;
bool used[2001];
long long id[2001];
long long zan[2001];
priority_queue<pair<long long, long long>, vector<pair<long long, long long> >,
               greater<pair<long long, long long> > >
    q1;
vector<pair<long long, long long> > v;
priority_queue<pair<long long, long long>, vector<pair<long long, long long> >,
               greater<pair<long long, long long> > >
    q;
long long calc() {
  long long l1 = -1LL;
  while (!q.empty()) q.pop();
  for (long long(i) = 0; (i) < (N); ++i) {
    zan[i] = 0LL;
  }
  v.clear();
  long long cnt = 0LL;
  long long cnt2;
  for (long long(i) = 0; (i) < (N); ++i) {
    if (used[i]) {
      zan[cnt] = cnt2;
      cnt2 = 0LL;
      cnt++;
    } else {
      q.push(pair<long long, long long>(A[i], cnt));
      cnt2++;
    }
  }
  zan[cnt] = cnt2;
  long long t = Q;
  long long res = 0LL;
  while (!q.empty()) {
    pair<long long, long long> p = q.top();
    q.pop();
    if (zan[p.second] <= K - 1LL) continue;
    if (l1 == -1LL) l1 = p.first;
    zan[p.second]--;
    t--;
    res = max(res, (long long)p.first);
    if (t == 0) return res - l1;
  }
  return inf;
}
long long ss() {
  priority_queue<long long, vector<long long>, greater<long long> > q3;
  for (long long(i) = 0; (i) < (N); ++i) q3.push(A[i]);
  long long r1 = q3.top();
  q3.pop();
  for (long long(i) = 0; (i) < (Q - 2LL); ++i) q3.pop();
  long long r2 = q3.top();
  q3.pop();
  return r2 - r1;
}
long long main() {
  cin >> N >> K >> Q;
  for (long long(i) = 0; (i) < (N); ++i) {
    cin >> A[i];
    q1.push(pair<long long, long long>(A[i], i));
  }
  if (Q == 1LL) {
    puts("0");
    return 0;
  }
  ans = ss();
  long long res;
  while (!q1.empty()) {
    pair<long long, long long> p = q1.top();
    q1.pop();
    used[p.second] = 1;
    res = calc();
    ans = min(ans, res);
  }
  cout << ans << endl;
}
