/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author yassin
 */

#include <bits/stdc++.h>

using namespace std;

class arc098e {
public:
    void solve(istream& in, ostream& out) {
        int N, K, Q;
        in >> N >> K >> Q;
        vector<int> A(N);
        for (int i = 0; i < N; ++i) {
            in >> A[i];
        }
        int res = 2'000'000'000;
        for (int i = 0; i < N; ++i) {
            int X = A[i];
            long long low = X, high = 2'000'000'000;
            int ans = high;
            while (low <= high) {
                int Y = (low + high) / 2;
                int cnt = 0;
                multiset<int> cur;
                for (int j = 0, k = 0; j < N; ) {
                    while (k < N && (int)cur.size() < K) {
                        cur.insert(A[k]);
                        ++k;
                    }
                    if ((int)cur.size() < K) {
                        break;
                    }
                    int mn = *cur.begin();
                    if (mn >= X && mn <= Y) {
                        ++cnt;
                        if (A[j] == mn) {
                            cur.erase(cur.begin());
                            ++j;
                        } else {
                            cur.erase(cur.begin());
                        }
                    } else {
                        if (cur.count(A[j])) {
                            cur.erase(cur.find(A[j]));
                        }
                        ++j;
                    }
                }
                if (cnt >= Q) {
                    high = Y - 1;
                    ans = Y;
                } else {
                    low = Y + 1;
                }
            }
            //cout << X << " " << ans << endl;
            res = min(res, ans - X);
        }
        out << res << "\n";
    }
};

int main() {
	std::ios::sync_with_stdio(false); cin.tie(nullptr);
	arc098e solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}
