#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2005;
int n, k, q, cnt;
int a[MAXN], b[MAXN], c[MAXN];
struct node {
  int pos, mn, sz, ls, rs;
  unsigned key;
  node() { memset(this, 0, sizeof(node)); }
  node(int _val) : key((unsigned)rand() * rand()), sz(1) {
    pos = mn = _val;
    ls = rs = 0;
  }
} d[MAXN];
class Treap {
 public:
  int rt, sz;
  struct dual_rt {
    int lrt, rrt;
    dual_rt(int _lrt = 0, int _rrt = 0) : lrt(_lrt), rrt(_rrt) {}
  };
  int new_nd(int val) {
    d[++cnt] = node(val);
    return cnt;
  }
  void upd(int u) {
    d[u].sz = d[d[u].ls].sz + d[d[u].rs].sz + 1;
    d[u].mn = d[u].pos;
    if (c[d[u].mn] > c[d[d[u].ls].mn]) d[u].mn = d[d[u].ls].mn;
    if (c[d[u].mn] > c[d[d[u].rs].mn]) d[u].mn = d[d[u].rs].mn;
  }
  dual_rt split(int u, int val) {
    dual_rt ret;
    if (!u) return ret;
    if (val < d[u].pos) {
      ret = split(d[u].ls, val);
      d[u].ls = ret.rrt;
      ret.rrt = u;
    } else {
      ret = split(d[u].rs, val);
      d[u].rs = ret.lrt;
      ret.lrt = u;
    }
    upd(u);
    return ret;
  }
  int merge(int u, int v) {
    if (!u || !v) return u | v;
    if (d[u].key < d[v].key) {
      d[u].rs = merge(d[u].rs, v);
      upd(u);
      return u;
    } else {
      d[v].ls = merge(u, d[v].ls);
      upd(v);
      return v;
    }
  }
  void clear() { rt = sz = 0; }
  void ist(int x) { ++sz, rt = merge(rt, new_nd(x)); }
  int del_mn() {
    int pos = d[rt].mn;
    dual_rt x = split(rt, pos);
    dual_rt y = split(x.lrt, pos - 1);
    rt = merge(y.lrt, x.rrt);
    --sz;
    return c[pos];
  }
} T[MAXN];
struct data {
  int id;
  data(int _id = 0) : id(_id){};
  bool operator<(const data &that) const {
    return c[d[T[id].rt].mn] < c[d[T[that.id].rt].mn] ||
           c[d[T[id].rt].mn] == c[d[T[that.id].rt].mn] && id < that.id;
  }
};
int main() {
  srand((size_t) new (char));
  scanf("%d%d%d", &n, &k, &q);
  a[0] = INT_MAX;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    b[i] = a[i];
  }
  sort(b + 1, b + n + 1);
  int tot = unique(b + 1, b + n + 1) - b - 1;
  int ans = INT_MAX;
  for (int i = 1, mn; i <= tot; ++i) {
    mn = b[i];
    int now = 1;
    cnt = 0;
    T[now].clear();
    bool flag = false;
    int _ = 0;
    c[0] = INT_MAX;
    int __ = 0;
    for (int j = 1; j <= n; ++j) {
      if (a[j] == mn)
        ++_;
      else
        c[++__] = a[j];
    }
    for (int j = 1; j <= __; ++j) {
      if (c[j] < mn) {
        if (flag) T[++now].clear();
      } else
        flag = true, T[now].ist(j);
    }
    set<data> se;
    for (int j = 1; j <= now; ++j) {
      if (T[now].sz >= k) se.insert(data(now));
    }
    int mx = mn;
    for (int j = _ + 1; j <= q; ++j) {
      if (se.empty()) {
        mx = INT_MAX;
        break;
      }
      int iter = se.begin()->id;
      se.erase(se.begin());
      mx = T[iter].del_mn();
      if (T[iter].sz >= k) se.insert(iter);
    }
    ans = min(ans, mx - mn);
  }
  printf("%d", ans);
  return 0;
}
