#include <bits/stdc++.h>

using namespace std;

#define int long long

signed main()
{
    int n, k, x, z=0, ans=0, c=1;
    cin >>n >> k >> x;
    vector<int> a(n+1);
    vector<int> ps(n+1);
    vector<vector<int>> v(n+1, vector<int>(x+1,1));
    ps[0]=0;
    for (int i=1; i<= n; i++)
    {
        cin >> a[i];
        ps[i]=ps[i-1]+a[i];
        if(i<=k)
        {
            ans+=a[i]*c;
            //cout << "ans++ " << ans;
            if(c<=x)
            {
                c++;
                //cout << "c++ "<< c;
            }
        }
    }
    //cout << endl;
    //for (auto i:ps)
    //    cout << i << " ";
    //cout << endl;

    cout << ans << endl;
    for (int i=1; i<=n-k; i++)
    {
        ans=ans-(ps[i+k-1]-ps[i-1])+a[i+k]*x;
        cout << ans << endl;
    }
}