#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
inline void Yes(bool condition) {
  if (condition)
    cout << "Yes"
         << "\n";
  else
    cout << "No"
         << "\n";
}
template <class itr>
void cins(itr first, itr last) {
  for (auto i = first; i != last; i++) {
    cin >> (*i);
  }
}
template <class itr>
void array_output(itr start, itr goal) {
  string ans = "", k = " ";
  for (auto i = start; i != goal; i++) ans += to_string(*i) + k;
  if (!ans.empty()) ans.pop_back();
  cout << ans << "\n";
}
ll gcd(ll a, ll b) { return a ? gcd(b % a, a) : b; }
const ll INF = 1e15;
const ll MOD = 1000000007;
const ll MAX = 400010;
constexpr ll nx[8] = {1, 0, -1, 0, -1, -1, 1, 1};
constexpr ll ny[8] = {0, 1, 0, -1, -1, 1, -1, 1};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n, k, q, c;
  cin >> n >> k >> q;
  vector<ll> a(n), b(n);
  for (ll i = ll(0); i < ll(n); ++i) {
    cin >> c;
    a[i] = b[i] = c;
  }
  sort((b).begin(), (b).end());
  b.erase(unique((b).begin(), (b).end()), b.end());
  ll ans = INF;
  for (ll i = ll(0); i < ll(min(n - k + 1, (ll)b.size())); ++i) {
    vector<vector<ll>> packet;
    vector<ll> stock;
    for (ll j = ll(0); j < ll(n); ++j) {
      if (a[j] < b[i]) {
        if (!stock.empty()) {
          packet.push_back(stock);
          stock.clear();
        }
      } else {
        stock.push_back(a[j]);
      }
    }
    if (!stock.empty()) packet.push_back(stock);
    stock.clear();
    for (ll j = ll(0); j < ll(packet.size()); ++j) {
      if (packet[j].size() < k) continue;
      sort((packet[j]).begin(), (packet[j]).end());
      for (ll l = ll(0); l < ll(packet[j].size() - k + 1); ++l) {
        stock.push_back(packet[j][l]);
      }
    }
    if (stock.size() < q) continue;
    chmin(ans, stock[q - 1] - stock[0]);
  }
  cout << ans << "\n";
}
