#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline long long rand(long long x, long long y) {
  return (rng() % (y + 1 - x)) + x;
}
string to_string(char c) {
  string second(1, c);
  return second;
}
template <typename T>
inline T gcd(T a, T b) {
  return a == 0 ? b : gcd(b % a, a);
}
long long int n, k, q, A[2006], o[2006];
long long int fw[2006];
void update(long long int x, long long int nval) {
  for (; x <= n; x += x & (-x)) fw[x] += nval;
}
void update(long long int x, long long int y, long long int nval) {
  update(x, nval);
  update(y + 1, -nval);
}
long long int sum(long long int x) {
  long long int ox = x;
  long long int res = 0;
  for (; x; x -= x & (-x)) res += fw[x];
  return ox - res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k >> q;
  for (long long int i = (1); i <= (long long int)(n); ++i) cin >> A[i];
  for (long long int i = (1); i <= (long long int)(n); ++i) o[i] = i;
  sort(o + 1, o + n + 1,
       [](long long int x, long long int y) { return A[x] < A[y]; });
  set<int> second;
  second.insert(0);
  second.insert(n + 1);
  function<long long int(long long int)> ppl = [&](long long int x) {
    return sum(*second.lower_bound(x)) - sum(*prev(second.lower_bound(x))) - 1;
  };
  long long int ans = ((long long)1e18);
  for (long long int i = (1); i <= (long long int)(n); ++i) {
    if (ppl(o[i]) < k) continue;
    memset((fw), 0, sizeof((fw)));
    long long int mx = A[o[i]];
    long long int have = 1;
    update(o[i] + 1, n, 1);
    for (long long int j = (i + 1); j <= (long long int)(n); ++j)
      if (have < q && ppl(o[j]) >= k) {
        ++have, mx = A[o[j]];
        update(o[j] + 1, n, 1);
      }
    second.insert(o[i]);
    ans = min(ans, mx - A[o[i]]);
  }
  cout << ans << '\n';
}
