#include <bits/stdc++.h>
#define int long long
#define ff first
#define dd second
#define mp make_pair
#define pb push_back
#define pp pair<int,int>
#define N 20005
using namespace std;

int tab[N];
int n, k, q, ans = 1e9;
int mini_index[N];

bool good(vector<int> temp, int a, int b) {
    //cout << "spr " << a << " " << b << endl;
   // for(auto &i:temp) cout << i << " "; cout << endl;
    int left = q-1;
    int size = 0; int propers = 0;
    for(int i = 0; i < (temp.size()+1); ++i) {
        if(temp[i] < a or i == temp.size()) {
            // do the work
                int canE = (size-k+1);
                left -= min(canE, propers);
            //
            if(left <= 0) return true;
            size = propers = 0;
            continue;
        }
        size++;
        if(temp[i] <= b) propers++;
    }
    return false;
}

bool test(int x) {
    for(int i = 0; i < (n-k+1); ++i) {
        vector<int> temp;
        for(int x = 0; x < n; ++x) {
            if(x != mini_index[i]) temp.pb(tab[x]);
        }

        int val = tab[mini_index[i]];

        int a = val-x,b = val;
        if(good(temp, a, b)) return true;
        a = val; b = val+x;
        if(good(temp,a,b)) return true;
    }
    return false;
}

main() {
    ios_base::sync_with_stdio(false);
    cin >> n >> k >> q;
    for(int i = 0; i < n; ++i) {
        cin >> tab[i];
    }

    for(int i = 0; i < (n-k+1); ++i) {
        int ind = -1; int mini = 1e9;
        for(int x = i; x < i+k; ++x) {
            if(mini > tab[x]) {mini = tab[x]; ind = x;}
        }
        mini_index[i] = ind;
    }

    int l = 0; int r = 1e9;
    while(r - l > 4) {
        int s = (l+r)/2;
        if(test(s)) {
            r = s;
        } else {
            l = s;
        }
    }
    for(int i = l; i <= r; ++i) if(test(i)) { cout << i << endl; exit(0);}

   // cout << test(1) << endl;
}