#include <bits/stdc++.h>
#define ll long long
#define endl '\n'

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    ll N, K, X, sum = 0, pref = 0, cnt = 0;
    cin >> N >> K >> X;
    vector <ll> A(N + 1);
    for(int i = 1; i <= N; i++) {cin >> A[i]; cnt += (A[i] >= 0);}
    if(cnt == N)
    {
        for(int i = 1; i <= K; i++)
        {
            if(i <= X) sum += (ll)i * A[i];
            else sum += X * A[i];
            if(i <= X) pref += A[i];
        }
        cout << sum << " ";
        for(int i = 1; i <= N - K; i++)
        {
            sum = sum - pref + X * A[i + K];
            pref -= A[i];
            pref += A[i + X];
            cout << sum << " ";
        }
        return 0;
    }

    return 0;
}