#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename... t>
using V = vector<t...>;
template <typename t>
void print(ostream& os, const t& a) {
  os << a << '\n';
}
template <typename t, typename... v>
void print(ostream& os, const t& a, v&&... b) {
  os << a << ' ';
  print(os, b...);
}
template <typename t>
void inp(t& a) {
  cin >> a;
}
template <typename t, typename... v>
void inp(t& a, v&... b) {
  cin >> a;
  inp(b...);
}
constexpr int maxn = 2e3;
int n, k, q, res = 1e9;
int tb[maxn + 1];
pair<int, int> ilo[maxn + 1];
inline int spr(int v) {
  V<int> fin;
  V<int> ar;
  for (int i = 0; i < n; ++i) {
    if (tb[i] < v) {
      sort(begin(ar), end(ar));
      int p = ar.size() - k + 1;
      for (int i = 0; i < p; ++i) fin.push_back(ar[i]);
      ar.clear();
    } else
      ar.push_back(tb[i]);
  }
  sort(begin(ar), end(ar));
  int p = ar.size() - k + 1;
  for (int i = 0; i < p; ++i) fin.push_back(ar[i]);
  sort(begin(fin), end(fin));
  return (q <= fin.size() ? fin[q - 1] : 1e9);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  inp(n, k, q);
  for (int i = 0; i < n; ++i) cin >> tb[i];
  for (int i = 0; i < n; ++i) ilo[i].first = tb[i], ilo[i].second = i;
  sort(ilo, ilo + n);
  for (int i = 0; i < n; ++i) res = min(res, spr(ilo[i].first) - ilo[i].first);
  print(cout, res);
}
