#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);
    }
    ll ans = 1e18;
    sort(p,p+n);

    ll INF=1e9;
    for(int end=0;end<=n;end++){
        ll imos[n]={};
        for(int j=0;j<end;j++){
            int q=p[j].second-k+1;
            imos[max(0,q)]++;
            imos[p[j].second]--;
        }
        for(int j=1;j<n;j++){
            imos[j] += imos[j-1];
        }
        for(int i=0;i<end;i++){
            imos[p[i].second]+=INF;
        }
        ll ret=0;
        priority_queue<ll,vector<ll>,greater<ll>> pq;
        for(int i=0;i<n;){
            int cnt=0;
            int cnt2=0;
            priority_queue<ll,vector<ll>,greater<ll>> pq2;
            while(i<n && imos[i]<INF){
                if(imos[i]==0) cnt++, pq2.push(a[i]);
                else {
                    cnt2++;
                    if(cnt && k-1 >= cnt2) pq2.push(a[i]);
                }
                i++;
            }
            int siz = pq2.size() - k + 1;
            for(int j=0;j<min(cnt,siz) ;j++){
                pq.push(pq2.top());
                pq2.pop();
            }
            i++;
        }
        if(pq.size()<q) break;
        ll mn = pq.top();
        for(int i=1;i<q;i++){
            pq.pop();
            ret=pq.top();
        }
        ret -= mn;
        ans = min(ans,ret);
    }


    cout << ans << endl;
    
}