#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
  for (int i = 0; i < (v.size()); i++) {
    os << v[i] << (i == v.size() - 1 ? "" : " ");
  }
  return os;
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
  for (T& x : v) {
    is >> x;
  }
  return is;
}
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<long long> a(n);
  cin >> a;
  long long ans = 1e9 + 5;
  vector<long long> v(k + q - 1);
  for (int i = 0; i < (n - (k + q) + 2); i++) {
    for (int j = (i); j < (i + k + q - 1); j++) {
      v[j - i] = a[j];
    }
    sort((v).begin(), (v).end());
    ans = min(ans, v[q - 1] - v[0]);
  }
  cout << ans << endl;
}
