#include <bits/stdc++.h>
using namespace std;
long long N,K,X,sum,c;
long long a[200022],ps[200022];
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> N >> K >> X;
    for(int i=1;i<=N;i++){
        cin >> a[i];
    }
    /**if(N>=20)
    {


        return 0;
    }**/
    for(int i=1;i<=N;i++){
        ps[i]=a[i]+ps[i-1];
        cout << ps[i] << " ";
    }
    cout << endl;

    c=1;
    for(int i=1;i<=K;i++){
        sum+=c*a[i];
        if(c<X) c++;
    }
    cout << sum << " ";
    for(int j=K+1;j<=N;j++){
        sum+=X*a[j];
        sum-=(ps[j-K+X-1]-ps[j-K-1]);
        ///cout <<ps[j-K+X-1]-ps[j-K-1]<< endl;
        cout << sum << " ";
    }
    cout << endl;



    return 0;
}
/// 7 4 2   2 3 5 2 1 3 7