#include <bits/stdc++.h>
using namespace std;
bool check(vector<int> &v, int x, int y, int k, int q) {
  int many = 0, n = v.size(), len = 0, greater = 0;
  for (int i = 0; i < n; ++i) {
    if (v[i] < x) {
      many += max(0, min(len - k + 1, len - greater));
      len = 0;
    } else {
      if (v[i] > y) greater += 1;
      len += 1;
    }
  }
  many += max(0, min(len - k + 1, len - greater));
  return many >= q;
}
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> v(n, 0);
  for (int i = 0; i < n; ++i) cin >> v[i];
  vector<int> w = v;
  sort(w.begin(), w.end());
  int ans = 2e9;
  for (int i = 0; i < n; ++i) {
    int x = w[i];
    int best = 2e9;
    for (int lf = i, rt = n - 1; lf <= rt;) {
      int mid = (lf + rt) / 2;
      int y = w[mid];
      if (check(v, x, y, k, q)) {
        best = y;
        rt = mid - 1;
      } else {
        lf = mid + 1;
      }
    }
    ans = min(ans, best - x);
  }
  cout << ans << "\n";
}
