#include <bits/stdc++.h>
using namespace std;
const double pi =
    3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod = 1000000007;
int main() {
  int n, k, q, a[2222] = {};
  cin >> n >> k >> q;
  int t = n - k - q + 1;
  for (int i = (0); i < (n); ++i) {
    cin >> a[i];
  }
  int ans = mod;
  for (int l = (0); l <= (t); ++l) {
    int r = t - l;
    int p = l, q = n - r;
    int m = q - p + 1;
    int b[2222] = {};
    for (int i = (p); i < (q); ++i) {
      b[i - p] = a[p];
    }
    sort(b, b + m);
    for (int i = (0); i < (k); ++i) {
      ans = min(b[m - 1 - (k - i)] - b[i], ans);
    }
  }
  cout << ans << endl;
  return 0;
}
