#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++){
        ll j=0;
        if (prvi) {s-=p[j]; j++;}
        cin>>p[i];
        s+=p[i]*c;
        if (c<x) {c++;}
        if (i==k-1) {prvi=true;}
        if (prvi) cout<<s<<" ";
    }
}