#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int ans = 2e9;
  for (int& bound : a) {
    vector<int> t;
    vector<int> s;
    for (int i = 0; i <= n; i++) {
      if (i == n || a[i] < bound) {
        sort(t.begin(), t.end());
        for (int i = 0; i <= (int) t.size() - k; i++) {
          s.push_back(t[i]);
        }
        t.clear();
      } else {
        t.push_back(a[i]);
      }
    }
    if ((int) s.size() < q) {
      continue;
    }
    sort(s.begin(), s.end());
    ans = min(ans, s[q - 1] - bound);
  }
  cout << ans << endl;
  return 0;
}