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

int main()
{
    ll n, k, x;
    cin>>n>>k>>x;
    vector<ll> p(n);
    ll c=1;
    ll s=0;
    bool prvi=false;
    for (ll i=0; i<n; i++){
            cin>>p[i];}
    for (ll i=0; i<n; i++){
        if (i>k-1) s-=p[i-k]*min(i-k+1, x);
        s+=p[i]*min(x,c);
        c++;
        if (i>=k-1) cout<<s<<" ";
        }

    }