#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define endl "\n"
///freopen("input.txt", "r", stdin);
///freopen("output.txt", "w", stdout);
void solve(){
    int n,k,x;
    cin>>n>>k>>x;

    bool pozitivni=true;
    vector<int>a(n);
    for(int i=0;i<n;i++){
        cin>>a[i];
        if(a[i]<0)pozitivni=false;
    }

    vector<ll>pref(n);
    for(int i=0;i<n;i++){
        if(i)pref[i]=pref[i-1];
        pref[i]+=a[i];
    }

    vector<ll>sufiksi(n);
    for(int i=n-1;i>=0;i--){
        if(i!=n-1)sufiksi[i]+=sufiksi[i+1];
        sufiksi[i]+=a[i];
    }


    if(pozitivni){
        for(int r=k-1,l=0;r<n;l++,r++){
            ll suma=pref[r];
            if(l)suma-=pref[l-1];
            //cout<<l<<"-"<<r<<endl;
            ///cout<<suma<<" ";

            ll brojevi=0;
            for(int i=0,l2=l+1;i<x-1&&l2<=r;i++,l2++){
                ll broj=sufiksi[l2];
                if(r!=n-1)broj-=sufiksi[r+1];

                ///cout<<broj<<" ";
                brojevi+=broj;
            }
            cout<<suma+brojevi<<" ";
        }
        return;
    }


    for(int r=k-1,l=0;r<n;l++,r++){
        ll suma=pref[r];
        if(l)suma-=pref[l-1];
        //cout<<l<<"-"<<r<<endl;
        ///cout<<suma<<" ";

        vector<ll>suf(k,0);
        for(int i=r,idx=k-2;i>l;idx--,i--){
            if(i!=r)suf[idx]=suf[idx+1];
            suf[idx]+=a[i];
        }
        sort(suf.rbegin(),suf.rend());
        ///cout<<suf[0]<<endl;
        ll zbir=0;
        for(int i=0;i<x-1;i++){
            //cout<<suf[i]<<" ";
            zbir+=suf[i];
        }
        //cout<<endl;
        cout<<suma+zbir<<" ";
    }







}
int main(){
    ios_base::sync_with_stdio(false);cin.tie(0);
    int t=1;///cin>>t;
    while(t--)solve();
    return 0;
}