#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define x first
#define y second

using namespace std;

typedef long long ll;

int mas[200005];

int main()
{
 	//freopen("input.txt", "r", stdin);
 	//freopen("output.txt", "w", stdout);
 	ios_base::sync_with_stdio(0); cin.tie(0);
 	int n;
 	cin >> n;
 	for (int i = 1; i <= n; i++) cin >> mas[i];

 	int mx = 0;
 	ll pref = 0, ans = 0;
 	for (int i = 1; i <= n; i++)
 	{
 		pref += (ll) mas[i];
 		ans += pref;
 		mx = max(mx, mas[i]);
 		cout << ans + (ll) i * (ll) mx << '\n';
 	}
 	return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(lint i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
///#pragma GCC optimize ("-O3")
ll input(){
    ll  n;
    cin >> n;
    return n;
}///input関数
ll combination(ll n,ll r){
    if (r == 0 || r == n)
        return (1);
    else if (r == 1)
        return (n);
    return (combination(n-1,r-1) + combination(n-1,r));

}///nCr
ll facctorialMethod(ll k){
    ll sum = 1;
    for (ll i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}///階乗

int main(){
    ll n = input();
    vector<ll>a;
    ll a_max = 0;
    ll ans = 0;
    ll total = 0;
    ll pir = 0;
    rep(i,0,n){
        a.push_back(input());
        pir += total;
        total += a.at(i);
        a_max = max(a_max,a.at(i));
        ans = pir + total + a_max*(i+1);
        cout << ans << endl;
    }
}