#include<bits/stdc++.h>
#define int long long
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define WT int T=read();while(T--) 
#define NO puts("NO");
#define YES puts("YES");
using namespace std;

inline int read()
{
    char c=getchar();int x=0;bool f=0;
    for(;!isdigit(c);c=getchar())f^=!(c^45);
    for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
    if(f)x=-x;return x;
}

const int M=2e5+10;
int sum[M],a[M],maxn[M],ans;

signed main()
{
	int n=read();
	for (int i=1;i<=n;i++)a[i]=read(),maxn[i]=max(maxn[i-1],a[i]),sum[i]=sum[i-1]+a[i];
	for (int i=1;i<=n;i++)
	{
		ans+=sum[i];ans-=maxn[i-1]*(i-1),ans+=i*maxn[i];
		cout<<ans<<endl;
	}
	return 0;
}
#include<cstdio>
using namespace std;
#define int long long
int n,a[200010],sum[200010],sum2[200010],mx[200010];
signed main(){
    scanf("%lld",&n);
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
        sum[i]=sum[i-1]+a[i];
        sum2[i]=sum2[i-1]+sum[i];
        mx[i]=(mx[i-1]>a[i]?mx[i-1]:a[i]);
    }
    for(int i=1;i<=n;i++){
        printf("%lld\n",sum2[i]+mx[i]*i);
    }
    return 0;
}