#include <bits/stdc++.h>
/*#include <iostream>
#include <algorithm>
#include <math.h>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <sstream>*/
 
#define ll long long
#define fop(i,m,n) for(ll i=m; i<n; i++)
#define fastIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define X first
#define Y second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define ep emplace_back
 
using namespace std;
 
const long long MOD = 998244353;
const long long N = 1e5+5;
const long long Nlog = 17;
const long long Hash = 257;
 
const double PI = 2.0*acos(0.0);//<cmath>
//const double PI = 3.141592653;
const double E = 2.718281828;


 
void solve(){
 
    ll n;
    cin >> n;
    ll a[n], m[n], p[n], pp[n];
    fop(i,0,n){
        cin >> a[i];
        if(i){
            m[i] = max(m[i-1], a[i]);
            p[i] = p[i-1] + a[i];
            pp[i] = pp[i-1] + p[i];
        }else{
            m[i] = a[i];
            p[i] = a[i];
            pp[i] = a[i];
        }
    }
    
    fop(i,0,n){
        cout << (i+1)*m[i] + pp[i] << '\n';
    }
    
 
}
 
 
int main()
{
    fastIO;
 
    int t=1;
    //cin >> t;
    while(t--) solve();
 
    return 0;
}
#include <iostream>

using namespace std;
using lint = long long;

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

    lint ma = 0, sum = 0, ans = 0;
    for (int k = 1; k <= n; ++k) {
        lint a;
        cin >> a;

        ma = max(ma, a);
        sum += a;
        ans += sum;

        cout << ans + ma * k << "\n";
    }
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    solve();

    return 0;
}
