#include <iostream>
#include<vector>
using namespace std;

int main()
{
    int n,k,x;
    cin>>n>>k>>x;
    vector<long long> a(n+1);
    int br = 0;
    for(int i = 1;i<=n;i++)
    {
        cin>>a[i];
        if(a[i]>=0)
            br++;
    }
    if(br==n)
    {
        vector<long long> pre(n+1),pre1(n+1);
        for(int i = 1;i<=n;i++)
        {
            pre[i] = a[i] + pre[i-1];
            pre1[i] = i*a[i] + pre1[i-1];
        }
        for(int i=1;i<=n-k+1;i++)
        {
            long long m = x*(pre[i+k-1] - pre[i+x-1]) + pre1[x+i-1] - pre1[i-1] - (i-1)*(pre[i+x-1] - pre[i-1]);
            cout<<m<<" ";
        }
        cout<<endl;
    }
    vector<pair<long long,long long>> v(n+1);
    v[1] = {a[1],a[1]};
    for(int i = 2;i<=x;i++)
    {
        v[i].second = i*a[i] + v[i-1].second;
        v[i].first = (i-1)*a[i] + max(v[i-1].first,v[i-1].second);
    }
    vector<vector<long long>> res(k+1);
    for(int i = x+1;i<=k;i++)
    {

    }
    cin>>n;
}