/**
*    author:  
*    created: 26.10.2020 13:52:11
**/

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i=0;i<n;i++)
typedef pair<ll,string> P;


int main() {
  
 
     ll n;
   cin >> n;
   vector <ll> a(n),b(n+1,0),c(n+1,0),d(n);
   

   rep(i,n){
       cin >> a.at(i);
       //pq.push(a.at(i));
     if(i==0)
       d.at(i)=a.at(i);
     else
       d.at(i)=max(d.at(i-1),a.at(i));
   }
  
  rep(i,n){
    b.at(i+1)=b.at(i)+a.at(i);
    c.at(i+1)=c.at(i)+b.at(i+1);
  }
  
  rep(i,n){
    //cout << b.at(i) <<' '<< c.at(i) <<' '<< d.at(i) << endl;
    cout << d.at(i)*(i+1)+c.at(i)+b.at(i+1) << endl;
  }
  
   
  
}
#include"bits/stdc++.h"
using namespace std;

long long N;
long long A[200000];
long long Max[200000] = { 0 };
long long _Max = 0;
long long A0_k = 0;
long long ans = 0;

int main(){
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		if (_Max < A[i]) {
			_Max = A[i];	
		}
		Max[i] = _Max;
	}
	for (int i = 0; i < N; i++) {
		A0_k += A[i];
		ans += A0_k;
		cout << ans + Max[i] * (i + 1) << endl;
	}
}