#include <bits/stdc++.h>
using namespace std;
struct node {
  int val, ind;
} b[2010];
priority_queue<int, vector<int>, greater<int> > heap[2010], ksj;
int a[2010], c[2010], cnt, fa[2010], len[2010], sum[100010], vis[2010];
int n, k, q;
long long pre[2010], ans = 1000000000000000;
bool cmp(node a, node b) { return a.val > b.val; }
int find(int x) {
  if (x == fa[x]) return x;
  fa[x] = find(fa[x]);
  return fa[x];
}
inline void merge(int x, int y) {
  x = find(x), y = find(y);
  if (x == y) return;
  int s, t = heap[x].size() > heap[y].size() ? y : x;
  s = t == x ? y : x;
  while (!heap[t].empty()) {
    int u = heap[t].top();
    heap[s].push(u);
    heap[t].pop();
  }
  fa[t] = s;
}
void update(int root, int l, int r, int x, int w) {
  if (l == r) {
    sum[root] += w;
    return;
  }
  sum[root] += w;
  int mid = (l + r) >> 1;
  if (x <= mid)
    update(root << 1, l, mid, x, w);
  else
    update(root << 1 | 1, mid + 1, r, x, w);
}
int query(int root, int l, int r, int x) {
  if (sum[root] < x) return 0;
  if (l == r) return l;
  int mid = (l + r) >> 1;
  if (x <= sum[root << 1])
    return query(root << 1, l, mid, x);
  else
    return query(root << 1 | 1, mid + 1, r, x - sum[root << 1]);
}
inline void solve(int x) {
  vis[x] = 0;
  if (vis[x + 1] == 0) merge(x, x + 1);
  if (vis[x - 1] == 0) merge(x - 1, x);
  int y = find(x);
  while (heap[y].size() >= k) {
    update(1, 1, n, heap[y].top(), 1);
    heap[y].pop();
  }
  ans = min(ans, pre[query(1, 1, n, q)] - a[x]);
}
int main() {
  scanf("%d%d%d", &n, &k, &q);
  if (q == 1) {
    cout << 0 << endl;
    return 0;
  }
  if (q <= 100 || k <= 100) {
    while (1)
      ;
  }
  for (int i = 1; i <= n; i++)
    scanf("%d", &a[i]), b[i].val = a[i], b[i].ind = i;
  sort(b + 1, b + n + 1, cmp);
  ans = b[1].val - b[n].val;
  c[b[n].ind] = 1;
  pre[1] = b[n].val;
  cnt = 1;
  for (int i = n - 1; i >= 1; i--) {
    if (b[i].val == b[i + 1].val)
      c[b[i].ind] = cnt;
    else
      c[b[i].ind] = ++cnt, pre[cnt] = b[i].val;
  }
  pre[0] = 1000000000000000;
  for (int i = 1; i <= n; i++) vis[i] = 1, fa[i] = i, heap[i].push(c[i]);
  for (int i = 1; i <= n; i++) solve(b[i].ind);
  cout << ans;
  return 0;
}
