#include <bits/stdc++.h>
using namespace std;
const long long inf = 1000000001;
const long long INF = 2e18;
const long long MOD = 1000000007;
const double pi = 3.14159265358979323846;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int dx2[8] = {1, 1, 0, -1, -1, -1, 0, 1}, dy2[8] = {0, 1, 1, 1, 0, -1, -1, -1};
class LazySegmentTree {
 public:
  int n;
  vector<pair<int, int> > node, lazy;
  LazySegmentTree(vector<pair<int, int> > a) {
    int _n = a.size();
    n = 1;
    while (n < _n) n *= 2;
    node.resize(2 * n - 1);
    lazy.resize(2 * n - 1, pair<int, int>(-2 * inf, -2 * inf));
    for (int i = 0; i < _n; i++) node[i + n - 1] = a[i];
    for (int i = n - 2; i >= 0; i--) {
      node[i].first = node[i * 2 + 1].first + node[i * 2 + 2].first;
      node[i].second = node[i * 2 + 1].second + node[i * 2 + 2].second;
    }
  }
  inline void eval(int k, int l, int r) {
    if (lazy[k].first != -2 * inf) {
      node[k].first = (r - l) * lazy[k].first;
      node[k].second = (r - l) * lazy[k].second;
      if (r - l > 1) {
        lazy[2 * k + 1] = lazy[k];
        lazy[2 * k + 2] = lazy[k];
      }
      lazy[k] = pair<int, int>(-2 * inf, -2 * inf);
    }
  }
  void add(int a, int b, pair<int, int> x, int k, int l, int r) {
    eval(k, l, r);
    if (b <= l || r <= a) return;
    if (a <= l && r <= b) {
      lazy[k] = x;
      eval(k, l, r);
    } else {
      add(a, b, x, 2 * k + 1, l, (l + r) / 2);
      add(a, b, x, 2 * k + 2, (l + r) / 2, r);
      node[k].first = node[2 * k + 1].first + node[2 * k + 2].first;
      node[k].second = node[2 * k + 1].second + node[2 * k + 2].second;
    }
  }
  pair<int, int> getsum(int a, int b, int k, int l, int r) {
    eval(k, l, r);
    if (b <= l || r <= a) return pair<int, int>(0, 0);
    if (a <= l && r <= b) return node[k];
    pair<int, int> resl = getsum(a, b, 2 * k + 1, l, (l + r) / 2);
    pair<int, int> resr = getsum(a, b, 2 * k + 2, (l + r) / 2, r);
    return pair<int, int>(resl.first + resr.first, resl.second + resr.second);
  }
};
class Bit {
 public:
  int n;
  vector<long long> bit;
  Bit(int _n) {
    n = _n;
    bit.resize(n);
  }
  long long sum(int i) {
    long long s = 0;
    i--;
    while (i > 0) {
      s += bit[i - 1];
      i -= i & -i;
    }
    return s;
  }
  void add(int i, long long x) {
    i++;
    while (i <= n) {
      bit[i - 1] += x;
      i += i & -i;
    }
  }
  long long min_xth(int x) {
    int left = 0, right = 200000;
    while (left + 1 < right) {
      int mid = (left + right) / 2;
      int temp = sum(mid);
      if (temp < x) {
        left = mid;
      } else {
        right = mid;
      }
    }
    return right;
  }
};
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i];
  }
  vector<pair<int, int> > ai(n);
  for (int i = 0; i < (int)(n); i++) {
    ai[i].first = a[i];
    ai[i].second = i;
  }
  sort(ai.begin(), ai.end());
  vector<int> idx(n);
  for (int i = 0; i < (int)(n); i++) {
    idx[i] = ai[i].second;
  }
  vector<bool> used(n);
  vector<pair<int, int> > b(n, pair<int, int>(-1, n));
  int ans = inf;
  for (int i = 0; i < (int)(n); i++) {
    LazySegmentTree lst(b);
    Bit bit(n);
    for (int j = 0; j < (int)(i); j++) {
      used[idx[j]] = true;
      pair<int, int> now = lst.getsum(idx[j], idx[j] + 1, 0, 0, lst.n);
      lst.add(now.first + 1, idx[j], pair<int, int>(now.first, idx[j]), 0, 0,
              lst.n);
      lst.add(idx[j] + 1, now.second, pair<int, int>(idx[j], now.second), 0, 0,
              lst.n);
    }
    int cnt = 0;
    int j = i;
    int mi = inf;
    int ma = 0;
    while (cnt < q && j < n) {
      pair<int, int> now = lst.getsum(idx[j], idx[j] + 1, 0, 0, lst.n);
      int num = bit.sum(now.second) - bit.sum(now.first);
      if (now.second - now.first - 1 - num < k) {
        used[idx[j]] = true;
        lst.add(now.first + 1, idx[j], pair<int, int>(now.first, idx[j]), 0, 0,
                lst.n);
        lst.add(idx[j] + 1, now.second, pair<int, int>(idx[j], now.second), 0,
                0, lst.n);
        j++;
        continue;
      }
      mi = min(mi, a[idx[j]]);
      ma = max(ma, a[idx[j]]);
      cnt++;
      bit.add(idx[j], 1);
      j++;
    }
    if (cnt < q) {
      break;
    } else {
      ans = min(ma - mi, ans);
    }
  }
  cout << ans << endl;
}
