#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;
    }
    else if(x==2)
    {
        vector<long long> pre(n+1);
        for(int i = 1;i<=n;i++)
        {
            pre[i] = a[i] + pre[i-1];
        }
        vector<pair<long long,int>> min(n+1);
        long long s = a[1];
        int j = 1;
        long long min1 = a[1];
        for(int i = 2;i<=k;i++)
        {
            s+=a[i];
            if(s<min1)
            {
                min1 = s;
                j = i;
            }
        }
        min[1].first = min1;
        min[1].second = j;
        for(int i = 2;i<=n-k+1;i++)
        {
            long long m = min[i-1].first - a[i-1];
            long long h = pre[i+k-1] - pre[i-1];
            if(m<h && min[i-1].second != i-1)
            {
                min[i].first = m;
                min[i].second = min[i-1].second;
            }
            else
            {
                min[i] = {h,i+k-1};
            }
        }
        for(int i = 1;i<=n-k+1;i++)
        {
            cout<<2*(pre[i+k-1] - pre[i-1]) - min[i].first<<" ";
        }

    }
    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++)
    {

    }
}