#include<ctime>
#include<cstdio>
#include<cctype>
#define ll long long
using namespace std;
const ll N=2e5+7;
ll read(){
	char c;
	ll x=0,f=1;
	while(!isdigit(c=getchar()))
		f-=2*(c=='-');
	while(isdigit(c)){
		x=x*10+f*(c-48);
		c=getchar();
	}
	return x;
}
ll n,sum,a[N],s[N],m[N];
int main(){
	#ifndef ONLINE_JUDGE
	freopen("A.in","r",stdin);
	freopen("A.out","w",stdout);
	#endif
	clock_t t1=clock();
	//--------
	n=read();
	for(ll i=1;i<=n;++i){
		a[i]=read();
		s[i]=s[i-1]+a[i];
		m[i]=m[i-1];
		if(a[i]>m[i])
			m[i]=a[i];
	}
	for(ll i=1;i<=n;++i){
		sum+=s[i];
		printf("%lld\n",sum+m[i]*i);
	}
	//--------
	fprintf(stderr,"%0.3lfs",1.0*(clock()-t1)/CLOCKS_PER_SEC);
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
int n;
cin >> n;
vector<long long>a(n);
vector<long long>b(n);
vector<long long>c(n);
vector<long long>d(n);
vector<long long>ans(n,0);
rep(i,n) cin >> a[i];
long long m = 0;
rep(i,n) {
    m = max(a[i],m);
  //  cout<<m<<endl;
    b[i] = m;
}

rep(i,n){
    if(i == 0) d[0] = a[0] ;
    else d[i] = d[i-1] + a[i];
}

rep(i,n){
    if(i == 0) c[0] = a[0] ;
    else c[i] = c[i-1] + d[i];
}

rep(i,n){
ans[i] = b[i] * (i+1) + c[i];
}

rep(i,n) cout<<ans[i]<<endl;
}
