#include <bits/stdc++.h>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
template <ostream& out = cout, class... T>
void prints(T&&...) {}
template <ostream& out = cout, class... T>
void printe(T&&...) {}
template <ostream& out = cout, class... T>
void printw(T&&...) {}
template <ostream& out = cout, class... T>
void printew(T&&...) {}
template <ostream& out = cout, class... T>
void printb(T&&...) {}
template <ostream& out = cout, class... T>
void printd(T&&...) {}
template <ostream& out = cout, class... T>
void printde(T&&...){};
template <class S, class T>
istream& operator>>(istream& in, pair<S, T>& p) {
  in >> p.first >> p.second;
  return in;
}
template <class T>
istream& operator>>(istream& in, vector<T>& v) {
  for (auto& e : v) {
    in >> e;
  }
  return in;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> as(n);
  cin >> as;
  int ans = M;
  for (int i = 0; i < n; i++) {
    vector<int> nums, avs;
    for (int j = 0; j < n; j++) {
      if (as[j] >= i) {
        nums.push_back(as[j]);
      } else {
        if ((int)nums.size() >= k) {
          sort(nums.begin(), nums.end());
          for (int i = 0; i < (int)nums.size() - k + 1; i++) {
            avs.push_back(nums[i]);
          }
        }
        nums.clear();
      }
    }
    if ((int)nums.size() >= k) {
      sort(nums.begin(), nums.end());
      for (int i = 0; i < (int)nums.size() - k + 1; i++) {
        avs.push_back(nums[i]);
      }
    }
    printd(i, avs);
    if ((int)avs.size() >= q) {
      sort(avs.begin(), avs.end());
      ans = min(ans, avs[q - 1] - avs[0]);
    }
  }
  cout << ans << '\n';
}
