#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll n, k, x;
vector<ll> p;
ll ans=LLONG_MIN;
ll maxval(ll i, ll granica, ll koef, ll cur){
   // cout << i << " " << granica << " " << koef << " " << cur << '\n' << '\n';
    if (i==granica) {if (koef>=x-1) ans=max(ans, cur); return cur;}
    ll val1=maxval(i+1, granica, koef, cur+p[i+1]*koef);
    if (koef==x) return val1;
    ll val2=maxval(i+1, granica, koef+1, cur+p[i+1]*(koef+1));
    if (i==(granica-x+1+koef)) return val2;
    if (koef<x) return max(val1, val2);
}
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    cin >> n >> k >> x;
    p.resize(n+2);
    //ll ps[n+2]; ps[0]=0;
    for (ll i=1;i<=n;i++){
        cin >> p[i];
        //ps[i]=ps[i-1]+p[i];
    }
    for (ll i=1;i<=n-k+1;i++){
        ans=LLONG_MIN;
        maxval(i, i+k-1, 1, p[i]);
        cout << ans << ' ';
    }
    return 0;
}