#include <bits/stdc++.h>
#define ll int
typedef long long ll;
using namespace std;
ll n , k , q;
ll a[2002];
const ll inf = 1e9;
bool take[2002];
ll solve(ll x)
{
        for(ll i=1;i<=n;i++) {
                if(a[i] < x) take[i] = false;
                else take[i] = true;
        }
        vector<ll> t;
        for(ll i=1;i<=n;i++) {
                if(take[i] == false) continue;
                ll j = i;
                while(j <= n && take[j] == true) j++;
                vector<ll> v;
                for(ll p = i ; p < j ; p++) v.pb(a[p]);
                ll sz = v.size();
                if(sz - k + 1 <= 0) continue;
                sort(v.begin() , v.end());
                for(ll p=0;p < sz-k+1 ; p++) t.pb(v[p]);
                i = j-1;
        }
        sort(t.begin() , t.end());
        if(t.size() < q) return inf;
        return t[q-1] - t[0];
}
int main()
{
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        cout.tie(NULL);
        cin >> n >> k >> q;
        for(ll i = 1 ; i <= n ; i++) {
                cin >> a[i];

        }
        ll ans = inf;
        for(ll i=1;i<=n;i++) {
                //cout << solve(a[i]) << endl;
                ans = min(ans , solve(a[i]));
        }
        cout << ans << endl;
        return 0;
}
