#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, k, c;
    cin>>n>>k>>c;
    vector <ll> niz(n);
    for (int i=0; i<n; i++) cin>>niz[i];
    vector <ll> pref(n);
    for (int i=0; i<n; i++)
    {
        if (i>0) pref[i]=pref[i-1]+niz[i];
        else pref[i]=niz[i];
    }
    for (int i=k-1; i<n; i++)
    {
        ll ans=c*pref[i]-(i-k>=0)*pref[i-k];
        set <ll> s;
        for (int j=i-k+1; j<=i; j++)
        {
            s.insert(pref[j]);
        }
        int cnt=0;
        for (auto j: s)
        {
            if (cnt==c-1) break;
            ans+=-j;
            cnt++;
        }
        cout<<ans<<'\n';
    }
    return 0;
}