#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = 1LL << 61;
struct query {
  long long type;
  long long value;
  query(long long a = 0, long long b = 0) : type(a), value(b) {}
};
long long INF = (1LL << 60);
struct segtree {
  long long SIZE;
  vector<query> s;
  vector<long long> t;
  vector<long long> u;
  segtree(long long n = 1) {
    SIZE = 1;
    while (SIZE < n) SIZE *= 2;
    s.clear();
    t.clear();
    u.clear();
    s.resize(SIZE * 2, query());
    t.resize(SIZE * 2, 0);
    u.resize(SIZE * 2, 0);
  }
  void func(long long k, long long l, long long r, query q) {
    if (q.type == 1) {
      if (s[k].type == 0)
        s[k] = q;
      else
        s[k].value += q.value;
      t[k] += q.value * (r - l);
      u[k] += q.value;
    }
    if (q.type == 2) {
      s[k] = q;
      t[k] = q.value * (r - l);
      u[k] = q.value;
    }
  }
  void compute(long long k, long long l, long long r) {
    query q = s[k];
    s[k] = query();
    if (q.type == 0 || r - l == 1) return;
    long long m = (l + r) / 2;
    func(k * 2 + 1, l, m, q);
    func(k * 2 + 2, m, r, q);
  }
  void Update(long long a, long long b, query x, long long k, long long l,
              long long r) {
    if (b <= l || r <= a) return;
    compute(k, l, r);
    if (a <= l && r <= b) {
      func(k, l, r, x);
    } else {
      long long m = (l + r) / 2;
      Update(a, b, x, k * 2 + 1, l, m);
      Update(a, b, x, k * 2 + 2, m, r);
      t[k] = t[k * 2 + 1] + t[k * 2 + 2];
      u[k] = min(u[k * 2 + 1], u[k * 2 + 2]);
    }
  }
  long long Dfs(long long type, long long a, long long b, long long k,
                long long l, long long r) {
    if (b <= l || r <= a) {
      if (type == 1) return 0;
      if (type == 2) return INF;
    }
    compute(k, l, r);
    if (a <= l && r <= b) {
      if (type == 1) return t[k];
      if (type == 2) return u[k];
    } else {
      long long m = (l + r) / 2;
      long long lv = Dfs(type, a, b, k * 2 + 1, l, m);
      long long rv = Dfs(type, a, b, k * 2 + 2, m, r);
      if (type == 1) return lv + rv;
      if (type == 2) return min(lv, rv);
    }
  }
  void Add(long long a, long long b, long long x) {
    Update(a, b, query(1, x), 0, 0, SIZE);
  }
  void Set(long long a, long long b, long long x) {
    Update(a, b, query(2, x), 0, 0, SIZE);
  }
  long long Getsum(long long a, long long b) {
    return Dfs(1, a, b, 0, 0, SIZE);
  }
  long long Getmin(long long a, long long b) {
    return Dfs(2, a, b, 0, 0, SIZE);
  }
};
int main() {
  long long n, k, q;
  cin >> n >> k >> q;
  vector<long long> a(n);
  segtree T(n + 1);
  T.Set(0, n + 1, INF);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    T.Set(i, i + 1, a[i]);
  }
  long long ans = inf;
  for (long long i = 0; i < n; i++) {
    priority_queue<long long, vector<long long>, greater<long long>> b;
    vector<long long> c;
    for (long long j = 0; j <= n; j++) {
      if (j == n || a[j] < a[i]) {
        long long m = b.size();
        for (long long j = 0; j < m; j++) {
          if (j < m - k + 1) {
            c.push_back(b.top());
          }
          b.pop();
        }
      } else {
        b.push(a[j]);
      }
      sort(c.begin(), c.end());
      if (c.size() >= q) {
        ans = min(ans, c[q - 1] - c[0]);
      }
    }
  }
  cout << ans << endl;
}
