#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    long long n,k,x;
    cin>>n>>k>>x;
    vector<long long>br(n+1),pr(n+1,0),iz(n-k+2,0);
    for(int i=1;i<=n;i++){
        cin>>br[i];
        pr[i]=pr[i-1]+br[i];
    }
    if(x==2){
        multiset<long long>skup;
        for(int i=1;i<=k;i++){
            skup.insert(pr[i]);
        }
        for(int i=1;i<n-k+2;i++){
            iz[i]=pr[i+k-1]-pr[i-1];
            if(pr[i+k-1]-*skup.begin()>0){
                iz[i]+=pr[i+k-1]-*skup.begin();
            }
            auto it=skup.find(pr[i]);
            skup.erase(it);
            if(i!=n-k+1)
                skup.insert(pr[i+k]);
        }
    }else{
    for(int i=1;i<n-k+2;i++){
        //cout<<endl<<i<<endl;
        long long c=1;
        iz[i]+=br[i];
        for(int j=i+1;j<i+k;j++){
            //cout<<endl<<j<<" "<<c+1+i+k-x<<endl<<j+x-c-1<<" "<<pr[j+x-c-1]<<" "<<j-1<<" "<<pr[j-1]<<endl<<i+k+c-x<<" "<<pr[i+k+c-x]<<endl;

            if(j==c+1+i+k-x){
                c++;
            }else if(pr[j+x-c-1]-pr[j-1]>0 && (pr[i+k+c-x]-pr[j-1]>0 || pr[i+k-1]-pr[j-1]>0)){
                c++;
            }
            c=min(c,x);
            iz[i]+=c*br[j];
            //cout<<c<<endl;
        }
    }}
    for(int i=1;i<n-k+2;i++){
        cout<<iz[i]<<" ";
    }
    return 0;
}