#include<bits/stdc++.h>
using namespace std;
typedef long long ll;



int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    ll n,k,q;
    cin>>n>>k>>q;
    ll a[n];
    pair<ll,ll> p[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
        p[i]=make_pair(a[i],i);
    }
    sort(p,p+n);
    
    ll ans = p[q-1].first - p[0].first;
    for(int i=1;i<=n-q;i++){
        ll imos[n]={};
        for(int j=0;j<i;j++){
            imos[max(0LL,p[i].second-k+1)]++;
            if(p[i].second+k-1<n-1) imos[p[i].second+k]--;  
        }
        for(int j=1;j<n;j++){
            imos[i] += imos[i-1];
        }
        for(int j=0;j<k;j++){
            imos[i]++;
            imos[n-1-i]++;
        }
        for(int j=0;j<i;j++){
            imos[p[i].second]++;
        }
        ll ret;
        priority_queue<ll,vector<ll>,greater<ll>> pq;
        for(int j=0;j<n;j++){
            if(imos[j]<2) pq.push(a[j]);
        }
        if(pq.size()<q) break;
        ll m=pq.top();
        ll M;
        for(int j=0;j<q;j++){
            pq.pop();
            M=pq.top();
        }
        ret = M-m;
        ans = min(ret,ans);
        
    }
    cout<<ans<<endl;
    

    
}
