#include <bits/stdc++.h>

using namespace std;

const int INF = 1000000010;

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(N);
  for(int i=0;i<N;i++) cin >> A[i];
  int ans = INF;
  for(int i=0;i<N;i++){
    int l = 0, r = 0;
    vector<int> vec;
    while(l < N){
      priority_queue<int, vector<int>, greater<int> > que;
      while(r < N && A[i] <= A[r]){
	       que.push(A[r]);
	       ++r;
      }
      while((int)que.size() >= K){
	       vec.push_back(que.top());
	       que.pop();
      }
      ++r;
      l = r;
    }
    if((int)vec.size() < Q) continue;
    sort(vec.begin(), vec.end());
    ans = min(ans, vec[Q-1] - vec[0]);
  }
  cout << ans << endl;
  return 0;
}