#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main(){
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
ll n, k, x; cin >> n >> k >> x;
ll p[n];
ll s[n+100];
cin >> p[0];
bool b = true;
s[0] = 0;
s[1] = p[0];
for( int i = 1; i < n; i++ ){
    cin >> p[i];
    if ( p[i] < 0 ){
        b = false;
    }
    s[i+1] = s[i] + p[i];
}
if ( x == 1 ){
    for ( int i = 0; i < n-k+1; i++ ){
        cout << s[i+k]-s[i] << " ";
    }
}
else{
if( x == 2 ){
    for ( int i = 0; i < n-k+1; i++ ){
        ll mini = p[i];
        for( int j = 1; j < k; j++ ){
            mini = min(mini, s[i+j+1]-s[i]);
        }
        cout << 2*(s[i+k] - s[i]) - mini << " ";
    }
}
else{
if ( b == true ){
    ll t[n];
    for ( int j = 0; j < x; j++ ){
        t[0]+= p[j]*(j+1);
    }
    for ( int l = x; l < k; l++ ){
        t[0] += p[l]*x;
    }
    cout << t[0] << " ";
    for ( int j = 1; j < n-k+1; j++ ){
        t[j] = t[j-1] + x*p[j+k]-p[j-1] - p[j];
        cout << t[j] << " ";
    }
}
else{







}
}
}
return 0;
}