#include <bits/stdc++.h>
using namespace std;
const int N=2000;
int a[N+1];
int main(){
  int n,k,q;
  scanf("%d%d%d",&n,&k,&q); 
  for (int i=0;i<n;i++)
    scanf("%d",&a[i]);
  int ans=1e9;
  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);
  }
  printf("%d\n",ans);
  return 0;
}