#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];
s[0] = 0;
s[1] = p[0];
for( int i = 1; i < n; i++ ){
    cin >> p[i];
    s[i+1] = s[i] + p[i];
}
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 << " ";
}

return 0;
}