#include<bits/stdc++.h>
using lint=long long;
using real=long double;
void cmn(lint&x,lint y){if(x>y)x=y;}
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    lint n,k,q;std::cin>>n>>k>>q;
    std::vector<lint>a(n);
    for(lint&x:a)std::cin>>x;
    lint ans=std::numeric_limits<lint>::max();
    for(lint Y:a){
        std::vector<lint>b;
        for(lint l=0,r=0;l<n;){
            for(l=r;l<n&&a.at(l)<Y;l++);
            for(r=l;r<n&&Y<=a.at(r);r++);
            if(r-l<k)continue;
            std::vector<lint>c={a.begin()+l,a.begin()+r};
            std::sort(c.rbegin(),c.rend());
            b.insert(b.end(),c.begin()+k-1,c.end());
        }
        if((lint)b.size()<q)continue;
        std::sort(b.begin(),b.end());
        cmn(ans,b.at(q-1)-Y);
    }
    std::cout<<ans<<'\n';
}
