#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  for (auto it = v.begin(); it != v.end(); ++it) {
    if (it != v.begin()) os << ",";
    os << *it;
  }
  return os << "}";
}
using ll = int64_t;
struct SegmentTree {
  static const int INIT_VALUE = 1 << 30;
  inline int calc(int a, int b) { return min(a, b); }
  vector<int> data;
  int n;
  explicit SegmentTree(int _n) {
    n = 1;
    while (n < _n) n *= 2;
    data = vector<int>(2 * n - 1, INIT_VALUE);
  }
  void update(int i, int v) {
    int k = i + n - 1;
    data[k] = v;
    while (k > 0) {
      k = parent(k);
      data[k] = calc(data[get_left(k)], data[get_right(k)]);
    }
  }
  inline int get(int a, int b) { return get(a, b, 0, 0, n); }

 private:
  int get(int a, int b, int k, int l, int r) {
    if (r <= a or b <= l) return INIT_VALUE;
    if (a <= l and r <= b) return data[k];
    int vl = get(a, b, get_left(k), l, (l + r) / 2);
    int vr = get(a, b, get_right(k), (l + r) / 2, r);
    return calc(vl, vr);
  }
  inline int get_left(int x) { return 2 * x + 1; }
  inline int get_right(int x) { return 2 * x + 2; }
  inline int parent(int x) { return (x - 1) / 2; }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  SegmentTree tree(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    tree.update(i, a[i]);
  }
  if (q == 1) {
    cout << 0 << endl;
    return 0;
  }
  int ret = 1000000001;
  for (int p = 0; p < n; p++) {
    ;
    vector<int> c = a;
    bool ok = false;
    for (int left = max(0, p - k + 1); left <= p; left++) {
      int right = left + k - 1;
      if (right >= n) break;
      ok = ok || tree.get(left, right + 1) == a[p];
    }
    if (!ok) continue;
    c.erase(c.begin() + p, c.begin() + p + 1);
    ;
    vector<pair<int, int>> ds;
    int left = 0;
    int n = c.size();
    while (left < n) {
      while (left < n && c[left] < a[p]) {
        left++;
      }
      int right = left;
      while (right < n && c[right] >= a[p]) {
        right++;
      }
      if (right == n) right--;
      if (right - left + 1 >= k) {
        ds.push_back({left, right});
      }
      left = right + 1;
    }
    std::vector<int> vv;
    for (auto p : ds) {
      sort(c.begin() + p.first, c.begin() + p.second + 1);
      for (int i = 0; i < p.second - p.first + 1 - k + 1; i++) {
        vv.push_back(c[p.first + i]);
      }
    };
    if (vv.size() < q - 1) continue;
    ;
    ;
    sort(vv.begin(), vv.end());
    int m = vv[q - 2];
    ret = min(ret, m - a[p]);
  }
  cout << ret << endl;
  return 0;
}
