#include<bits/stdc++.h>
using namespace std;
int main(){
    long long n,k,x;
    cin>>n>>k>>x;
    x--;
    long long niz[n+1];
    niz[0] = 0;
    for(long long i=1;i<=n;i++){
        cin>>niz[i];
    }
    long long p[n+1];
    p[0] = 0;
    for(long long i=1;i<=n;i++){
        p[i] = p[i-1] + niz[i];
    }
    long long sum = 0;
    for(long long i=1;i<=x;i++){
        sum += i*niz[i];
    }
    for(long long i=x+1;i<=k;i++){
        sum += (x+1)*niz[i];
    }
    cout<<sum<<" ";
    for(long long i=2;i<=n-k+1;i++){
        sum = sum + (x+1)*(i+k-1) - p[i+x-1] + p[i-2];
        cout<<sum<<" ";
    }
}