#include <bits/stdc++.h>
#define pb(x) push_back(x)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define F(w,x,y) for(ll w=x; w<y; w++)
#define endl "\n"
#define mod 1000000007
typedef long long ll;
typedef long double ld;
using namespace std;

void play()
{
    ll n,a;
    cin>>n;
    vector <ll> pref(n+1);
    pref[0]=0;
    vector <ll> maxi(n+1,0);
    maxi[0]=0;
    F(i,1,n+1)
    {
        cin>>a;
        pref[i]=pref[i-1]+a;
        maxi[i]=max(maxi[i-1],a);
    }
    ll sum=0;
    F(i,1,n+1)
    {
        sum+=pref[i];
        cout<<sum+(maxi[i]*i)<<endl;
    }
}

int main()
{
    //freopen("milkvisits.in","r",stdin);
    //freopen("milkvisits.out","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //pre();
    ll t;
    t=1;
    //cin>>t;
    F(i,1,t+1)
    {
        //cout<<"Case #"<<i<<": ";
        play();
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
int n,a[200010];
long long sum[200010],ma;
void solve() {
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	for(int i=1;i<=n;i++) sum[i]=sum[i-1]+a[i];
	for(int i=1;i<=n;i++) sum[i]=sum[i-1]+sum[i];
	for(int i=1;i<=n;i++) {
		ma=max(ma,(long long)a[i]);
		printf("%lld\n",sum[i]+1ll*ma*i);
	}
}
int main() {
	int t=1;//scanf("%d",&t);
	while(t--) solve();
}
