#include <bits/stdc++.h>
using namespace std;
template <class A>
void pr(A a) {
  cout << a;
  cout << '\n';
}
template <class A, class B>
void pr(A a, B b) {
  cout << a << ' ';
  pr(b);
}
template <class A, class B, class C>
void pr(A a, B b, C c) {
  cout << a << ' ';
  pr(b, c);
}
template <class A, class B, class C, class D>
void pr(A a, B b, C c, D d) {
  cout << a << ' ';
  pr(b, c, d);
}
template <class A>
void PR(A a, long long n) {
  for (long long i = (long long)(0); i < (long long)(n); i++) {
    if (i) cout << ' ';
    cout << a[i];
  }
  cout << '\n';
}
long long check(long long n, long long m, long long x, long long y) {
  return x >= 0 && x < n && y >= 0 && y < m;
}
const long long MAX = 1e9 + 7, MAXL = 1LL << 61, dx[4] = {-1, 0, 1, 0},
                dy[4] = {0, 1, 0, -1};
class RMQ {
 public:
  int n;
  pair<int, int> dat[555555];
  void init(int _n) {
    n = 1;
    while (n < _n) n *= 2;
    for (long long i = (long long)(0); i < (long long)(2 * n); i++)
      dat[i] = pair<int, int>(MAX, -1);
  }
  void update(int k, pair<int, int> a) {
    k += n - 1;
    dat[k] = a;
    while (k > 0) {
      k = (k - 1) / 2;
      dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);
    }
  }
  pair<int, int> query(int a, int b) { return query(a, b, 0, 0, n); }
  pair<int, int> query(int a, int b, int k, int l, int r) {
    if (r <= a || b <= l) return pair<int, int>(MAX, -1);
    if (a <= l && r <= b) return dat[k];
    pair<int, int> vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
    pair<int, int> vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
    return min(vl, vr);
  }
};
RMQ r;
void Main() {
  long long n, m, k;
  cin >> n >> m >> k;
  long long a[n];
  for (long long i = (long long)(0); i < (long long)(n); i++) cin >> a[i];
  set<int> s;
  for (long long i = (long long)(0); i < (long long)(n); i++) s.insert(a[i]);
  s.insert(0);
  int ans = MAX;
  for (__typeof((s).begin()) it = (s).begin(); it != (s).end(); it++) {
    r.init(n);
    int x = 0;
    priority_queue<int, vector<int>, greater<int> > que[n];
    for (long long i = (long long)(0); i < (long long)(n); i++) {
      if (a[i] <= *it)
        x = i + 1;
      else
        que[x].push(a[i]);
    }
    int cnt = 0;
    for (long long i = (long long)(0); i < (long long)(n); i++) {
      if (que[i].size() >= m) {
        r.update(i, pair<int, int>(que[i].top(), i));
        cnt += que[i].size() - m + 1;
      }
    }
    if (cnt < k) break;
    int Mi = MAX, Ma = -MAX;
    for (long long i = (long long)(0); i < (long long)(k); i++) {
      pair<int, int> p = r.query(0, n);
      Mi = min(Mi, p.first);
      Ma = max(Ma, p.first);
      que[p.second].pop();
      if (que[p.second].size() >= m)
        r.update(p.second, pair<int, int>(que[p.second].top(), p.second));
    }
    ans = min(ans, Ma - Mi);
  }
  pr(ans);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  Main();
  return 0;
}
