#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<algorithm>
#include<numeric>
#include<cmath>
#include<iomanip>
#include<regex>
using namespace std;
#define int long long
const int mod=1e9+7;
signed main(){
	int n,a[200000];
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>a[i];
	int mx=0,sum=0,ans=0;
	for(int i=0;i<n;i++){
		sum+=a[i];
		if(mx<a[i]){
			ans+=(a[i]-mx)*i;
			mx=a[i];
		}
		ans+=sum+mx;
		cout<<ans<<endl;
	}
}

/*
	ॐ
		JAI SHREE RAM

		Hare Krishna Hare Krishna Krishna Krishna Hare Hare
		Hare Rama Hare Rama Rama Rama Hare Hare
	
												ॐ
*/

//Written by Bhuwanesh Nainwal
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
pbds;



#define fast            	ios_base::sync_with_stdio(false) , cin.tie(NULL) , cout.tie(NULL)
#define int					long long int
#define vci              	vector<int>
#define vcvci             	vector<vector<int>>
#define vcpi             	vector<pair<int,int>>
#define vcs					vector<string>
#define pb              	push_back
#define mpii             	map<int , int>
#define mpsi             	map<string , int>
#define mpci             	map<char , int>
#define umpii             	unordered_map<int , int>
#define umpsi             	unordered_map<string , int>
#define umpci             	unordered_map<char , int>
#define all(x)				auto it = x.begin() ; it != x.end() ; it++
#define vcc              	vector<char>
#define vcs              	vector<string>
#define sti            		set<int>
#define stc            		set<char>
#define sts            		set<string>
#define pqmx				priority_queue<int>
#define pqmn				priority_queue<int , vi , greater<int>>
#define null            	NULL
#define ff            		first
#define ss              	second
#define stb(x)				__builtin_popcount(x)
#define lzr(x)				__builtin_clz(x)
#define tzr(x)					__builtin_ctz(x)
#define prc(x , y)          fixed << setprecision(y) << x
#define max3(a, b, c)   	max(a, max(b, c))
#define min3(a, b, c)   	min(a, min(b, c))

using namespace std;

const int mod = 1e9 + 7;
const int INF = 1e9;
const int LINF = 1e18;
const int N = 1e4;
const int chkprc = 1e-9;  // Check for precision error in double


void solve()
{
	int n;
	cin >> n;

	vci a(n);
	vci pre(n);
	vci mx(n);
	vci mxind(n);
	for(int i = 0 ; i < n ; i++)
	{
		cin >> a[i];
		if(i == 0)
			pre[i] = a[i];
		else
			pre[i] = pre[i - 1] + a[i];
		if(i == 0)
		{
			mx[i] = a[i];
			mxind[i] = i;
		}
		
		else
		{
			if(a[i] > mx[i - 1])
				mxind[i] = i;
			else
				mxind[i] = mxind[i - 1];
			mx[i] = max(mx[i - 1] , a[i]);
		}
	}	

	int ans = a[0];
	cout << 2 * ans << "\n";
	for(int i = 1 ; i < n ; i++)
	{	
		ans = ans + pre[i];
		// if(i == 1)
		// {
		// 	cout << ans << " ";
		// 	cout << mx[i] << " ";
		// 	cout << (n - mxind[i]) << " ";
		// 	cout << ans  - (mx[i]  * (n - mxind[i])) << " ";
		// }
		int f = ans  - (mx[i]  * (i + 1 - mxind[i])) + (mxind[i] * mx[i]) + (2 * (i - mxind[i] + 1) * mx[i]);
		cout << f << "\n";
	}
	// cout << mx[1] << " " << mxind[1];
	


}

void local()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif // ONLINE_JUDGE
}

int32_t main()
{

    fast;
    //local();
    int T = 1;
    // cin>>T;

    while(T--)
    {
        solve();
    }

    return 0;
}