#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int infi = 2147483600;
const long long infl = 1e17;
struct SegmentTree {
 private:
  int N;
  vector<long long> node;
  long long e;

 public:
  SegmentTree() {}
  SegmentTree(long long e) : e(e) {}
  void __init__(int sz) {
    N = 1;
    while (N < sz) N *= 2;
    node.resize(2 * N - 1, e);
  }
  void build(vector<long long> &v) {
    int sz = int(v.size());
    __init__(sz);
    for (long long i = 0; i < (long long)sz; i++) {
      node[i + N - 1] = v[i];
    }
    for (int i = N - 2; i >= 0; i--) {
      node[i] = min(node[i * 2 + 1], node[i * 2 + 2]);
    }
  }
  void update(int k, long long x) {
    k += N - 1;
    node[k] = x;
    while (k > 0) {
      k = (k - 1) / 2;
      node[k] = min(node[2 * k + 1], node[2 * k + 2]);
    }
  }
  void renew(int b, int e, long long x) {
    renew(b, e, 0, 0, N, x);
    return;
  }
  void renew(int b, int e, int k, int l, int r, long long x) {
    if (e <= 0 || b >= N) return;
    if (k > 0) {
      node[k] = min(node[k], node[(k - 1) / 2]);
    }
    if (r < b || e < l) return;
    if (b <= l && r <= e) {
      node[k] = min(node[k], x);
      return;
    } else if (k < N - 1) {
      renew(b, e, 2 * k + 1, l, (l + r) / 2, x);
      renew(b, e, 2 * k + 2, (l + r) / 2, r, x);
      return;
    }
    return;
  }
  long long get(int i) {
    int k = i + N - 1;
    long long res = node[k];
    while (k > 0) {
      k = (k - 1) / 2;
      res = min(res, node[k]);
    }
    return res;
  }
  long long query(int a, int b) { return query(a, b, 0, 0, N); }
  long long query(int a, int b, int k, int l, int r) {
    if (b <= l || r <= a) return e;
    if (a <= l && r <= b) return node[k];
    long long vl, vr;
    vl = query(a, b, 2 * k + 1, l, (l + r) / 2);
    vr = query(a, b, 2 * k + 2, (l + r) / 2, r);
    return min(vl, vr);
  }
  void recalc() {
    for (long long k = 0; k < (long long)N - 1; k++) {
      node[2 * k + 1] = min(node[2 * k * 1], node[k]);
      node[2 * k + 2] = min(node[2 * k * 2], node[k]);
    }
  }
  long long show_one(int i) { return node[i + N - 1]; }
  void show() {
    for (long long i = 0; i < (long long)N; i++) cout << node[i] << " ";
    cout << endl;
    return;
  }
};
SegmentTree seg(infl);
int main() {
  long long n, k, q;
  cin >> n >> k >> q;
  vector<long long> a(n);
  for (long long i = 0; i < (long long)n; i++) cin >> a[i];
  seg.build(a);
  vector<long long> b(n);
  copy((a).begin(), (a).end(), b.begin());
  sort((b).begin(), (b).end());
  for (auto x : b) cout << x << " ";
  cout << endl;
  long long ans = infl;
  for (long long s = 0; s < (long long)n; s++) {
    vector<long long> value;
    long long res = 0;
    long long idx = 0;
    while (idx + k <= n) {
      if (seg.query(idx, idx + k) >= b[s]) {
        multiset<long long> now;
        long long cnt = 1;
        for (long long i = (long long)idx; i < (long long)idx + k; i++)
          now.insert(a[i]);
        idx += k;
        while (idx < n) {
          if (a[idx] >= b[s]) {
            now.insert(a[idx]);
            idx++;
            cnt++;
          } else {
            idx++;
            break;
          }
        }
        for (auto x = now.begin(); cnt > 0; x++) {
          value.push_back(*x);
          cnt--;
        }
      } else {
        idx++;
      }
    }
    if (value.size() < q) {
      continue;
    } else {
      sort((value).begin(), (value).end());
      ans = min(ans, value[q - 1] - value[0]);
    }
  }
  cout << ans << endl;
}
