#include <bits/stdc++.h>
using namespace std;
template <typename T, typename S>
ostream &operator<<(ostream &os, const pair<T, S> &p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <typename C, typename T = decay<decltype(*begin(declval<C>()))>,
          typename enable_if<!is_same<C, string>::value>::type * = nullptr>
ostream &operator<<(ostream &os, const C &c) {
  bool f = true;
  os << "[";
  for (const auto &x : c) {
    if (!f) os << ", ";
    f = false;
    os << x;
  }
  return os << "]";
}
template <typename T>
void debug(string s, T x) {
  cerr << s << " = " << x << "\n";
}
template <typename T, typename... Args>
void debug(string s, T x, Args... args) {
  cerr << s.substr(0, s.find(',')) << " = " << x << " | ";
  debug(s.substr(s.find(',') + 2), args...);
}
int n, bit[2005];
int query(int i) {
  int ret = 0;
  for (; i > 0; i -= i & -i) ret += bit[i];
  return ret;
}
void update(int i) {
  for (; i <= n; i += i & -i) bit[i]++;
}
int sum(int i, int j) { return query(j) - query(i - 1); }
pair<int, int> a[2005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int k, q;
  cin >> n >> k >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i + 1;
  }
  sort(a, a + n);
  set<int> st{0, n + 1};
  int ret = INT_MAX;
  for (int i = 0; i <= n - q; i++) {
    memset(bit, 0, sizeof(bit));
    if (i > 0) st.insert(a[i - 1].second);
    bool ok = true;
    for (int j = i; j < i + q; j++) {
      auto it = st.lower_bound(a[j].second);
      int r = *it - 1, l = *(--it) + 1;
      if (r - l + 1 - sum(l, r) < k) {
        ok = false;
        break;
      }
      update(a[j].second);
    }
    if (ok) ret = min(ret, a[i + q - 1].first - a[i].first);
  }
  cout << ret << "\n";
  return 0;
}
