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

void solve() {
    int n;
    cin>>n;
    ll a, sum=0, high=0, ans=0;
    for(int i=0; i<n; i++) {
        cin>>a;
        sum+=a;
        ans+=sum;
        high=max(high, a);
        cout<<ans+(i+1)*high<<endl;
    }
    return;
}

int main() {
#ifdef bipinpathak
    (void)!freopen("input.txt", "r", stdin);
    (void)!freopen("output.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    auto start=clock();
    int t = 1;
    //cin>>t;
    for(int i=0; i<t; i++) {
        //cout<<"Case #"<<i+1<<": ";
        solve();
    }
    double used= (double) (clock()-start);
    used=(used*1000)/CLOCKS_PER_SEC;
    cerr<<fixed<<setprecision(2)<<used<<" ms"<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
  ll N,max = 0,sum = 0,ans = 0;
  cin >> N;
  vector<ll> A(N),B(N);
  for(ll i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  for(ll i = 0; i < N; i++){
    if(max < A.at(i)) max = A.at(i);
    sum += A.at(i);
    ans += sum;
    cout << ans + (i + 1) * max << endl;
  }
}