#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
template <class T>
ostream& operator<<(ostream& o, const vector<T>& v) {
  o << "{";
  for (long long i = 0; i < (long long)v.size(); i++)
    o << (i > 0 ? ", " : "") << v[i];
  o << "}";
  return o;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& pair_var) {
  os << "(" << pair_var.first << ", " << pair_var.second << ")";
  return os;
}
long long n, k, l, q, res;
long long a[2100] = {};
long long c[1000][1000] = {};
long long dp[2020][2020] = {};
long long hidari[2][2020] = {};
long long wpos[2020][2020] = {};
long long bpos[2020][2020] = {};
string s;
long long mi = 1LL << 29;
vector<pair<char, long long>> vec;
signed main() {
  std::cin >> n >> k >> q;
  for (long long i = 0; i < n; i++) {
    std::cin >> a[i];
  }
  for (long long i = 0; i < n; i++) {
    vector<long long> V;
    vector<long long> P;
    long long syo = a[i];
    for (long long j = 0; j < n; j++) {
      if (syo <= a[j]) {
        V.push_back(a[j]);
      } else {
        if (V.size() >= k) {
          sort((V).begin(), (V).end());
          for (long long l = 0; l < V.size() - k + 1; l++) {
            P.push_back(V[l]);
          }
          V.clear();
        }
      }
    }
    if (V.size() >= k) {
      sort((V).begin(), (V).end());
      for (long long l = 0; l < V.size() - k + 1; l++) {
        P.push_back(V[l]);
      }
      V.clear();
    }
    if (P.size() >= q) {
      sort((P).begin(), (P).end());
      mi = min(mi, P[q - 1] - P[0]);
    }
  }
  std::cout << mi << '\n';
}
