#include <bits/stdc++.h>

#define int int64_t

using namespace std;

int a[200010];

int calcaura(int i, int c, int k){
    int aura = 0;

    int prevj = i+k-1;
    while(c>1){
        int mxs = a[prevj];
        int mxj = prevj;
        int sum = 0;
        for(int j = prevj; j >= i+c-1; j--){
            sum+=a[j];
            if(sum>mxs){
                mxs = sum;
                mxj = j;
            }
        }
        for(int j = prevj; j >= mxj; j--){
            aura+=a[j]*c;
        }

        prevj=mxj-1;
        c--;
    }
    for(int j = prevj; j >= i; j--) aura+=a[j];

    return aura;
}

int32_t main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n, k, x; cin >> n >> k >> x;
    for(int i = 1; i <= n; i++) cin >> a[i];
    for(int i = 1; i <= n-k+1; i++){

        cout << max(calcaura(i, x, k), calcaura(i, x-1, k)) << " ";
    }

    return 0;
}