#include <bits/stdc++.h>
const int INF = 1000000010;
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, k, q;
  int ans = INF;
  cin >> n >> k >> q;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    vector<int> v;
    priority_queue<int, vector<int>, greater<int> > que;
    int l = 0, r = 0;
    while (l < n) {
      while (r < n && a[i] <= a[r]) {
        que.push(a[r]);
        r++;
      }
      while ((int)que.size() >= k) {
        v.push_back(que.top());
        que.pop();
      }
      r++;
      l = r;
      if ((int)v.size() < q) continue;
      sort(v.begin(), v.end());
      ans = min(ans, v[q - 1] - v[0]);
    }
  }
  cout << ans << endl;
  return 0;
}
