#include<bits/stdc++.h>
#define MAXN 300005
#define INF 0x3f3f3f3f
typedef long long ll;
using namespace std;

int n;
ll a[MAXN],maxl[MAXN],sum[MAXN],val[MAXN];

ll f(ll len){return maxl[len] * len + sum[len] + val[len];}

int main(){
	cin>>n;for(int i = 1 ; i <= n ; i++)cin>>a[i];
	maxl[0] = -INF;
	for(int i = 1 ; i <= n ; i++){
		maxl[i] = max(maxl[i - 1] , a[i]);
		sum[i] = sum[i - 1] + a[i];
		val[i] = val[i - 1] + a[i - 1];
	}
	for(int i = 1 ; i <= n ; i++)val[i] = val[i] + val[i - 1];
	for(int i = 1 ; i <= n ; i++)cout<<f(i)<<endl;
}
#include "bits/stdc++.h"
using namespace std;
 
#define ffor(n) for(int i = 0; i < n; i++)
#define fffor(n) for(int j = 0; j < n; j++)
#define uwu ios::sync_with_stdio(false);cin.tie(NULL);
#pragma GCC optimize("Ofast")
 
const int INF = 1e9 + 7;
const long long INF2 = 1e17;

int main(void) {
	uwu
	
	// when adding some integer to v, it only affects the answer if it is larger than any other previous element
	// v[0] = a[0] + x, v[1] = a[1] + (a[0] + x), v[2] = a[2] + (a[0] + a[1] + x), ...
	// for n terms, sum is n * x + (a[0] + a[0] + a[1] + a[0] + a[1] + a[2] + ...)
	int n; cin >> n;
	vector <long long> v(n);
	ffor(n) cin >> v[i];
	
	vector <long long> prefix(n);
	prefix[0] = v[0];
	for(int i = 1; i < n; i++) prefix[i] = prefix[i - 1] + v[i];
	
	long long current_sum = 0, maximum = 0;
	for(int i = 0; i < n; i++) {
		maximum = max(maximum, v[i]);
		current_sum += prefix[i];
		cout << (i + 1) * maximum + current_sum << '\n';
	}
}

/*
C:\Users\kenne\OneDrive\Desktop\competitive_programming\main.cpp
*/
