#include<bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define deb(...)
#endif
#define int long long int
void solve() {

    int n;
    cin >> n;
    vector<int>v(n);
    for (int i = 0; i < n; i++) {
        cin >> v[i];
    }
    vector<int>pref(n);
    int sum = 0;
    for (int i = 0; i < n; i++) {
        sum += v[i];
        pref[i] = sum;
    }
    vector<int>pref1(n);
    sum = 0;
    for (int i = 0; i < n; i++) {
        if (i == 0) {
            pref1[i] = sum;
            sum += v[i];
            continue;
        }
        pref1[i] = pref1[i - 1] + sum;
        sum += v[i];
    }
    vector<int>ans(n);
    int maxi = 0;
    for (int i = 0; i < n; i++) {
        maxi = max(maxi, v[i]);
        ans[i] = pref[i] + pref1[i] + (i + 1) * maxi;
    }
    for (auto it : ans) {
        cout << it << endl;
    }



}
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int  t = 1;
    //cin >> t;
    while (t--) solve();
    return 0;
}
#pragma GCC optimize ("trapv")
#include <bits/stdc++.h>
#include<algorithm>
#include <vector>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<string.h>
using namespace std;
#define pb push_back
#define all(v) v. begin(),v. end()
#define  rep(i,n,v) for(i=n;i<v;i++)
#define per(i,n,v) for(i=n;i>v;i--)
#define ff first 
#define ss second 
#define pp pair<ll,ll>
#define ll  long long
#define endl '\n'
vector<vector<ll>>v;
void dfs(vector<vector<ll>>&a, ll i,ll j, ll n)
{
  if(v[i][j]==0 && a[i][j]==1)
  {
    v[i][j]=3;
    if(i+1<n) dfs(a, i+1,j,n);
    if(i+1<n && j+1<n) dfs(a, i+1,j+1,n);
    if(i+1<n && j-1>=0) dfs(a, i+1,j-1,n);
  }
}
void solve()
{
  ll n,m=INT_MIN,b=0, c=0,k=0, i, j, l=1e9+7;
  string s, r, y;
  ll hit=0;
  cin>>n;
  ll ar[n];
  vector<ll>vec;
  rep(i, 0,n) cin>>ar[i];
  vec.pb(0);
  rep(i, 0,n)
  {
    vec.pb(ar[i]+vec[i]);
  }
  //rep(i, 0,vec.size()) cout<<vec[i]<<" ";
  rep(i,0,n)
  {
    m=max(m,ar[i]);
    k+=vec[i+1];
    cout<<m*(i+1)+k<<endl;
  }
} 
int main()
{
  ll i, j, b=0, c=1,yog=0,hit=1;
 ios_base::sync_with_stdio(false);
  cin. tie(0);cout. tie(0);
    ll t=1;
//cin>>t;
    while(t--)
    {
      solve();
    }
    return 0;
}