#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define ld long double
#define iter vector<ll>::iterator
#define mp make_pair
#define pb push_back
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)

ll fact(ll n){
 
	if(n==1){
		return 1;
	}
	else{
		return n*fact(n-1);
	}
}
int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b); 
     
}
ll binpow(ll a, ll b) {
    if (b == 0)
        return 1;
    long long res = binpow(a, b / 2);
    if (b % 2)
        return res * res * a;
    else
        return res * res;
}
ll binpow(ll a, ll b, ll m) {
    a %= m;
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}

int main() {
    ll n;
    
    cin >> n;
    ll arr[n], max1[n]={0}, sum[n]={0}, t[n]={0};
    for(int i=0;i<n;i++){
        cin >> arr[i];
    }
    max1[0]=arr[0];
    sum[0]=arr[0];
    t[0]=arr[0];
    for(int i=1;i<n;i++){
        max1[i]=max(max1[i-1],arr[i]);
        sum[i] = sum[i-1]+arr[i];
        t[i] = t[i-1]+ sum[i];
    }
    for(int k=1;k<=n;k++){
        ll ma = max1[k-1];
        ll sum1 = t[k-1]+(k*ma);
        // for(int i=0;i<k;i++){
        //     b[i]+=ma;
        //     ma = b[i];
        // }
        // int sum=0;
        // for(int i=0;i<k;i++){
        //     sum+=b[i];
        // }
        cout << sum1 << endl;
    }
    return 0;
}

#include <cstdlib>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ii pair<int,int>
#define vi vector<int>
#define vii vector<ii>
#define vc vector<char>
#define vs vector<string>
#define vd vector<double>
#define vll vector<ll>
#define vvi vector<vi>
#define vvii vector<vii>
#define vvc vector<vc>
#define vvs vector<vs>
#define vvll vector<vll>
#define vvd vector<vd>
#define FOR(x,n) for(int x=0;x<n;x++)
#define FORS(x,n) for(int x=1;x<=n;x++)
#define FORE(x,a) for(auto &x: a)
#define ALL(x) x.begin(),x.end()
#define REP(n) for(int _ = 0; _ < n; _++)
#define MT make_tuple
#define pb push_back
#define endl '\n'
#define F first
#define S second

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int t;
  cin >> t;
  cout << max(0,t) << endl;
}
