#include <bits/stdc++.h>
using namespace std;
int dx[8] = {1, 0, 0, -1, 1, 1, -1, -1};
int dy[8] = {0, -1, 1, 0, -1, 1, -1, 1};
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
bool isprime[1000000 + 5];
void init_prime() {
  fill(isprime, isprime + 1000000 + 5, true);
  isprime[0] = isprime[1] = false;
  for (int i = (0), loop_end_i = (1000000 + 5); i < (loop_end_i); i++) {
    if (isprime[i]) {
      for (int j = i * 2; j < 1000000; j += i) {
        isprime[j] = false;
      }
    }
  }
}
vector<long long> factors(long long n) {
  vector<long long> v;
  for (long long i = (0), loop_end_i = (1000000); i < (loop_end_i); i++) {
    if (!isprime[i]) continue;
    while (n % i == 0) {
      v.push_back(i);
      n /= i;
    }
  }
  if (n > 1) {
    v.push_back(n);
  }
  return v;
}
template <typename T = int>
class bit {
 public:
  T *bit_arr;
  int size;
  bit(int n) {
    size = n;
    bit_arr = new T[n];
    fill(bit_arr, bit_arr + n, 0);
  }
  ~bit() { delete bit_arr; }
  T sum(int a) {
    T ret = 0;
    while (a) {
      ret += bit_arr[a];
      a -= a & -a;
    }
    return ret;
  }
  T sum(int a, int b) { return sum(b) - sum(a); }
  T get(int a) { return sum(a, a + 1); }
  void add(int a, T x) {
    a++;
    while (a < size) {
      bit_arr[a] += x;
      a += a & -a;
    }
  }
  void set(int a, T x) { add(a, x - get(a)); }
};
template <typename T = int, class Compare = less<T>>
class rmq {
 public:
  int size;
  Compare comp;
  pair<T, int> *dat;
  T init;
  pair<T, int> mymin(pair<T, int> x, pair<T, int> y) {
    if (x.first == y.first)
      return make_pair(x.first, min(x.second, y.second));
    else if (min(x.first, y.first, comp) == x.first)
      return x;
    else
      return y;
  }
  rmq(int n, T init_ = INT_MAX) {
    init = init_;
    size = 2;
    while (size < n) size *= 2;
    dat = new pair<T, int>[2 * size - 1];
    for (int i = (0), loop_end_i = (n); i < (loop_end_i); i++)
      dat[size - 1 + i] = make_pair(init, i);
    for (int i = size - 2; i >= 0; i--)
      dat[i] = mymin(dat[i * 2 + 1], dat[i * 2 + 2]);
  }
  ~rmq() { delete dat; }
  void set(int k, T a) {
    k += size - 1;
    dat[k] = make_pair(a, k - (size - 1));
    while (k > 0) {
      k = (k - 1) / 2;
      dat[k] = mymin(dat[k * 2 + 1], dat[k * 2 + 2]);
    }
  }
  pair<T, int> get(int a, int b, int k, int l, int r) {
    if (r <= a || b <= l) return make_pair(init, -1);
    if (a <= l && r <= b)
      return dat[k];
    else {
      pair<T, int> vl = get(a, b, k * 2 + 1, l, (l + r) / 2);
      pair<T, int> vr = get(a, b, k * 2 + 2, (l + r) / 2, r);
      return mymin(vl, vr);
    }
  }
  pair<T, int> getp(int a, int b) { return get(a, b, 0, 0, size); }
  T get(int a, int b) { return getp(a, b).first; }
  int geti(int a, int b) { return getp(a, b).second; }
};
int n, k, q;
rmq<int, greater<int>> qmax(12, INT_MIN);
rmq<int> qmin(12);
int a[12];
vector<pair<int, int>> v;
vector<int> u;
int main() {
  {
    scanf("%d", &(n));
    scanf("%d", &(k));
    scanf("%d", &(q));
  };
  for (int i = (0), loop_end_i = (n); i < (loop_end_i); i++) {
    scanf("%d", &(a[i]));
  };
  for (int i = (0), loop_end_i = (n); i < (loop_end_i); i++)
    v.push_back(make_pair(a[i], i));
  sort((v).begin(), (v).end());
  int x = 0;
  int ans = INT_MAX;
  while (1) {
    int f = 0;
    u.clear();
    for (int i = (0), loop_end_i = (n); i < (loop_end_i); i++)
      qmin.set(i, a[i]);
    for (int i = (0), loop_end_i = (n); i < (loop_end_i); i++)
      qmax.set(i, a[i]);
    for (int i = (0), loop_end_i = (n); i < (loop_end_i); i++) {
      if (a[i] <= x) {
        u.push_back(i);
        qmin.set(i, INT_MAX);
        qmax.set(i, INT_MIN);
        f++;
      }
    }
    u.push_back(n);
    int s = 0;
    for (int t : u) {
      for (int i = (0), loop_end_i = (min(k - 1, t - s)); i < (loop_end_i);
           i++) {
        int j = qmax.geti(s, t);
        qmin.set(j, INT_MAX);
        qmax.set(j, INT_MIN);
        f++;
      }
      s = t + 1;
    }
    if (n - f < q) break;
    int mi = -1, mx;
    for (int i = (0), loop_end_i = (q); i < (loop_end_i); i++) {
      int j = qmin.geti(0, n);
      if (!~mi) mi = a[j];
      mx = a[j];
      qmin.set(j, INT_MAX);
    }
    ((ans) = min((ans), (mx - mi)));
    f = 0;
    while (f < n && v[f].first <= x) f++;
    if (f == n) break;
    x = v[f].first;
  }
  printf("%d\n", ans);
}
