#include <bits/stdc++.h>
using namespace std;
using int32 = int_fast32_t;
using int64 = int_fast64_t;
const int32 INF = 1e9;
const int32 MOD = 1e9 + 7;
const int64 LLINF = 1e18;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int32 n, k, q;
  cin >> n >> k >> q;
  vector<pair<int32, bool>> a(n);
  for (int64 i = 0; i < (n); ++i) {
    cin >> a[i].first;
    a[i].second =
        (max<int32>(0, i - k + 1) + max<int32>(0, n - i - 1 - k + 1) >= q);
  }
  int32 ans = INF;
  sort((a).begin(), (a).end());
  for (int64 i = 0; i < (n); ++i) {
    if (i + q - 1 >= n) break;
    ans = min(ans, a[i + q - 1].first - a[i].first);
    if (!a[i].second) break;
  }
  cout << (ans) << "\n";
  return 0;
}
