#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template <class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 2100100100;
const int MOD = 1e9 + 7;

ll N, M, K, Q;
string S;

int main() {
    cin >> N >> K >> Q;
    vector<ll> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A.at(i);
    }

    ll ans = 1e18;
    for (int i = 0; i + K + Q - 1 <= N; i++) {
        vector<ll> B;
        for (int j = 0; j < K + Q - 1; j++) {
            B.push_back(A[i + j]);
        }
        sort(B.begin(), B.end());
        chmin(ans, abs(B[Q - 1] - B[0]));
    }
    cout << ans << endl;

    return 0;
}
