#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n, k, q;
    cin>>n>>k>>q;
    vector<int> a(n);
    for(auto& e: a) cin>>e;
    a.push_back(0);

    int res=INT_MAX;
    for(int i=0; i<n; ++i) {
        int y=a[i];
        vector<int> v;
        priority_queue<int, vector<int>, greater<int>> q2;
        for(int j=0; j<=n; ++j) {
            if (a[j]>=y) {
                q2.push(a[j]);
            }
            else {
                while (q2.size()>=k) {
                    v.push_back(q2.top());
                    q2.pop();
                }
                while (q2.size()) q2.pop();
            }
        }
        if (v.size()>=q) {
            sort(begin(v), end(v));
            res=min(res, v[q-1]-y);
        }
    }
    cout<<res<<endl;
}