#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e4;
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll INF = 1 << 30;
const ll INF2 = 9e18;
const double INF3 = 9e14;
const double eps = 1e-10;
const double PI = 3.14159265358979323846;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const int tx[8] = {-1, 0, 1, -1, 1, -1, 0, 1},
          ty[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
ll N, k, q, ans = INF2;
vector<ll> a;
struct segtree {
 private:
  ll n;
  vector<ll> node;

 public:
  segtree(vector<ll> v, ll fi) {
    ll sz = v.size();
    n = 1;
    while (n < sz) n *= 2;
    node.resize(2 * n - 1, fi);
    for (int i = 0; i < sz; i++) node[i + n - 1] = v[i];
    for (int i = n - 2; i >= 0; i--)
      node[i] = min(node[2 * i + 1], node[2 * i + 2]);
  }
  void update(ll x, ll val) {
    x += (n - 1);
    node[x] = val;
    while (x > 0) {
      x = (x - 1) / 2;
      node[x] = min(node[2 * x + 1], node[2 * x + 2]);
    }
  }
  ll getmin(int a, int b, int k = 0, int l = 0, int r = -1) {
    if (r < 0) r = n;
    if (r <= a || b <= l) return INF2;
    if (a <= l && r <= b) return node[k];
    ll vl = getmin(a, b, 2 * k + 1, l, (l + r) / 2);
    ll vr = getmin(a, b, 2 * k + 2, (l + r) / 2, r);
    return min(vl, vr);
  }
};
ll div(segtree seg, ll mini) {
  int l = 0, r = 1;
  vector<ll> v;
  for (; l < N && r <= N;) {
    priority_queue<ll, vector<ll>, greater<ll>> pq;
    for (; seg.getmin(l, r) >= mini && r <= N; r++) {
      l++;
      pq.push(a[l]);
    }
    r++;
    l = r - 1;
    while (pq.size() >= k) {
      v.emplace_back(pq.top());
      pq.pop();
    }
  }
  sort((v).begin(), (v).end());
  if (v.size() < q) return INF2;
  return v[q - 1];
}
int main() {
  cin >> N >> k >> q;
  a.resize(N);
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  segtree seg(a, 0);
  for (int i = 0; i < N; i++) {
    ans = min(ans, div(seg, a[i]) - a[i]);
  }
  cout << ans << endl;
  return 0;
}
