#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, k, x;
    cin >> n >> k >> x;
    vector<long long> pref(n+1);
    pref[0] = 0;
    for(int i = 1; i <= n; i++){
        long long t;
        cin >> t;
        pref[i] = t+pref[i-1];
    }
    vector<long long> kon;
    for(int i = 1; i <= n-k+1; i++){
        long long res = pref[i+k-1]-pref[i-1];
        long long maks = LLONG_MIN;
        int m = k+1;
        for(int tx = x; tx >= 2; tx--){
            maks = LLONG_MIN;
            int prom = -1;
            for(int j = tx-1; j<m; j++){
                long long c = pref[k+i-1]-pref[i+j-1];
                if(c>maks){
                    maks = c;
                    prom=j;
                }
            }
            //cout << res << " " << maks << "\n";
            res = res+maks;
            m = prom;
        }
        kon.push_back(res);

    }
    /*for(int i = 0; i <= n; i++){
        cout << pref[i] << " ";
    }
    cout << "\n";*/
    for(int i = 0; i < n-k+1; i++){
        cout << kon[i] << " ";
    }
    cout << "\n";
    return 0;
}