#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const double PI = 3.14159265359;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k, q;
  cin >> n >> k >> q;
  vector<long long> v(n);
  for (auto& i : v) cin >> i;
  sort(v.begin(), v.end());
  if (q > 50) {
    long long ans = MOD;
    for (int i = 0; i + q < n; i++) {
      ans = min(ans, v[i + q - 1] - v[i]);
    }
    cout << ans;
    return 0;
  } else {
    long long ans = MOD;
    int trails = 10000;
    for (int i = 0; i < trails; i++) {
      auto cur = v;
      vector<long long> chosen(q);
      for (int j = 0; j < q; j++) {
        uniform_int_distribution<int> dist(0, cur.size() - k);
        std::default_random_engine gen;
        auto it = cur.begin() + dist(gen);
        auto itrem = it;
        for (int j2 = 0; j2 < k; j2++) {
          if (*(cur.begin() + j2) < *itrem) itrem = cur.begin() + j2;
        }
        chosen[j] = *itrem;
        cur.erase(itrem);
      }
      ans = min(ans, *max_element(chosen.begin(), chosen.end()) -
                         *min_element(chosen.begin(), chosen.end()));
    }
    cout << ans;
  }
}
