#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)1e5 + 5;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0), cout.precision(10),
      cout << fixed;
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> arr(n);
  for (int &x : arr) cin >> x;
  int ans = INT_MAX;
  for (int i = 0; i < n; ++i) {
    int x = arr[i];
    vector<int> tmp;
    for (int j = 0; j < n; ++j) {
      if (arr[j] >= x) tmp.push_back(arr[j]);
    }
    if ((int)tmp.size() - q >= k - 1) {
      sort(tmp.begin(), tmp.end());
      ans = min(ans, tmp[q - 1] - x);
    }
  }
  cout << ans << '\n';
  return 0;
}
