#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...)name
#define _rep(i,n)repi(i,0,n)
#define repi(i,a,b)for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x)x
#define rep(...)MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c)c.begin(),c.end()
#define write(x)cout<<(x)<<'\n'
using namespace std; typedef long long ll; template<class T>using vv = vector<vector<T>>;
template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T, class U>bool chmax(T& a, U&& b) { return a < b ? a = b, 1 : 0; }
template<class T, class U>bool chmin(T& a, U&& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;
constexpr int dy[4] = { 0,1,0,-1 }; constexpr int dx[4] = { 1,0,-1,0 };

int main() {
    int N, K, Q;
    cin >> N >> K >> Q;
    vector<int> A(N);
    rep(i, N) cin >> A[i];

    vector<int> B, C;
    int ans = INT32_MAX;
    rep(i, N) {
        C.resize(0);

        for (int j = 0, k; j < N; j = k) {
            for (k = j + 1; k < N; ++k) {
                if (A[k] < A[i]) break;
            }
            if (A[j] >= A[i] && k - j >= K) {
                B.resize(0);
                rep(l, j, k) B.push_back(A[l]);
                sort(all(B));
                rep(l, 0, (k - j) - K + 1) C.push_back(B[l]);
            }
        }

        if ((int)C.size() < Q) continue;
        sort(all(C));
        ans = min(ans, C[Q - 1] - A[i]);
    }

    write(ans);
}