w//=================================
// Created on: 2018/09/22 00:40:43
//=================================
#include <bits/stdc++.h>
using ll = long long;
int main()
{
    int N, K, Q;
    std::cin >> N >> K >> Q;
    std::vector<ll> A(N);
    std::map<ll, std::vector<int>> mp;
    for (int i = 0; i < N; i++) { std::cin >> A[i], mp[A[i]].push_back(i); }
    auto B = A;
    std::sort(B.begin(), B.end());
    std::vector<bool> ok(N, true);
    ll ans = 1LL << 60;
    for (int i = 0; i < N; i++) {
        const ll L = (i == 0 ? -1 : B[i - 1]);
        for (const auto e : mp[L]) { ok[e] = false; }
        std::vector<ll> v;
        std::vector<ll> buf;
        buf.reserve(N);
        for (int pos = 0; pos < N; pos++) {
            if (ok[pos]) {
                buf.push_back(A[pos]);
            } else {
                if (buf.size() > K - 1) {
                    std::sort(buf.begin(), buf.end());
                    for (int i = 0; i < buf.size() - K + 1; i++) { v.push_back(buf[i]); }
                }
                buf.clear();
            }
        }
        if (buf.size() > K - 1) {
            std::sort(buf.begin(), buf.end());
            for (int i = 0; i < buf.size() - K + 1; i++) { v.push_back(buf[i]); }
        }

        if (v.size() < Q) { continue; }
        std::sort(v.begin(), v.end());
        ans = std::min(ans, v[Q - 1] - B[i]);
    }
    std::cout << ans << std::endl;

    return 0;
}
