#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-10;
const long long INFLL = (long long)(1e9) * (long long)(1e9);
const int INF = 1e9;
template <class T>
void chmin(T& a, const T b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T& a, const T b) {
  if (a < b) a = b;
}
const long long pow(const long long p, const long long q) {
  long long t = 1;
  for (int i = 0; i < q; i++) t *= p;
  return t;
}
template <typename T>
struct has_iter {
 private:
  template <typename U>
  static constexpr true_type check(typename U::iterator*);
  template <typename U>
  static constexpr false_type check(...);

 public:
  static constexpr bool value = decltype(check<T>(nullptr))::value;
};
template <typename T, typename U = typename T::iterator>
void print(const T& container) {
  auto &&first = begin(container), last = end(container);
  auto&& back = prev(last);
  for (auto e = first; e != last; e = next(e)) cout << *e << " \n"[e == back];
}
extern void* enabler;
template <typename Head,
          typename enable_if<!has_iter<Head>::value>::type*& = enabler>
void print(const Head& head) {
  cout << head << "\n";
}
template <>
void print<string>(const string& container) {
  cout << container << "\n";
}
template <typename Head, typename... Tail>
void print(const Head& head, const Tail&... tail) {
  cout << head << " ";
  print(tail...);
}
void io_speedup() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
}
template <typename T>
istream& operator>>(istream& is, vector<T>& vec) {
  for (T& x : vec) is >> x;
  return is;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  os << '(' << p.first << ", " << p.second << ')';
  return os;
}
template <typename T>
vector<T> read(int n) {
  vector<T> t(n);
  cin >> t;
  return t;
}
template <typename T>
T read() {
  T t;
  cin >> t;
  return t;
}
template <typename Head, typename... Tail>
struct vector_demensions {
  using type = vector<typename vector_demensions<Tail...>::type>;
};
template <typename Head>
struct vector_demensions<Head> {
  using type = Head;
};
template <typename T>
vector<T> make_vectors(int size, T val) {
  return vector<T>(size, val);
}
template <typename T = int, typename... Args>
auto make_vectors(int size, Args... tail) ->
    typename vector_demensions<Args..., T>::type {
  auto val = make_vectors<T>(forward<Args>(tail)...);
  return vector<decltype(val)>(size, val);
}
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(read<int>(n));
  vector<pair<int, int>> p(n);
  for (int i = (0); i < (int)(n); ++i) p[i] = pair<int, int>(a[i], i);
  sort(p.begin(), p.end());
  vector<char> used(n, 1);
  int ans = INF * 2;
  for (int i = (0); i < (int)(n); ++i) {
    vector<vector<int>> c;
    vector<int> ary;
    int ind = 0;
    c.push_back(vector<int>());
    for (int j = (0); j < (int)(n); ++j) {
      if (used[j]) {
        c[ind].push_back(a[j]);
      } else {
        if (j - 1 >= 0 && used[j - 1]) {
          ind++;
          c.push_back(vector<int>());
        }
      }
    }
    for (int j = (0); j < (int)(c.size()); ++j) {
      sort(c[j].begin(), c[j].end());
      for (int l = (0); l < (int)(c[j].size() - k + 1); ++l) {
        ary.push_back(c[j][l]);
      }
    }
    if (ary.size() < q) break;
    chmin(ans, ary[q - 1] - ary[0]);
    used[p[i].second] = 0;
  }
  print(ans);
}
