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

int A[2005];

int main(){
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    int n, k, q, ans = 2e9; cin >> n >> k >> q;
    for(int i=0;i<n;i++) cin >> A[i];

    A[n] = -1;
    for(int i=0;i<n;i++){
        vector<int> c, b;
        for(int j=0;j<=n;j++){
            if(A[j]<A[i]){
                sort(b.begin(), b.end());
                for(int l=0;l<(int)b.size()-k+1;l++) c.push_back(b[l]);
                b.clear();
            }
            else b.push_back(A[j]);
        }
        if(c.size()<q) continue;
        sort(c.begin(), c.end());
        ans = min(ans, c[q-1]-c[0]);
    }

    cout << ans << endl;
    return 0;
}