#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int n,k,Q;
  cin>>n>>k>>Q;
  int a[2000],b[2000];
  for(int i=0;i<n;i++){
    cin>>a[i];
    b[i]=a[i];
  }
  sort(b,b+n);
  int ans=b[Q-1]-b[0];
  for(int m=0;m<n;m++){
    priority_queue<int> q;
    for(int i=0;i<n;i++){
      if(a[i]<a[m]){
	continue;
      }
      priority_queue<int> q2;
      while(a[i]>=a[m]){
	q2.push(-a[i]);
	i++;
	if(i==n)break;
      }
      while(q2.size()>k-1){
	q.push(q2.top());
	q2.pop();
      }
    }
    if(q.size()<Q)continue;
    int y=-q.top();
    for(int i=0;i<Q-1;i++){
      q.pop();
    }
    int x=-q.top();
    ans=min(ans,x-y);
  }
  cout<<ans<<endl;
  return 0;
}
