#include<bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define pii pair<int,int>
#define vpii vector<pair<int,int>>
#define pqueue priority_queue
#define umap unordered_map
#define uset unordered_set
#define bit(s, i) ((1 << i) & s ? 1 : 0)
#define bits(x) __builtin_popcount((x))
#define gcd(x, y) __gcd(x, y)
#define lcm(x, y) ((x) / gcd(x, y) * (y))
#define inf 4557430888798830399LL
#define mst(dp, val) memset(dp, val, sizeof(dp))
#define rep(i, a, b) for (int i = a; i <= b; ++i)
#define repd(i, a, b, d) for (int i = a; i <= b; i += d)
#define rep_(i, a, b) for (int i = a; i >= b; --i)
#define repd_(i, a, b) for (int i = a; i >= b; i -= d)
#define mxm(a, b) a = max(a, b) 
#define mnm(a, b) a = min(a, b)
#define Max *max_element
#define Min *min_element
#define pb push_back
#define X first
#define Y second
#define L size()
#define all(x) (x).begin(), (x).end()
#define debug(x) cout << #x << "=" << x << endl
#define readArr(a, n) for (int i = 1; i <= n; i++) cin >> a[i];
#define printArr(a, n) for (int i = 1; i <= n; i++) cout << a[i] << " "; cout << endl;
#define print(e) cout << (e) << endl
const int mod = 1e9 + 7;
#define Add(x, val) x = (x + (val)) % mod
// #define MULTI_CASES
// #define PRE

const int N = 2e5 + 5;
int a[N];

void solve() {
    int n; cin >> n;
    readArr(a, n);
    int mx = 0;
    int preSum = 0;
    int h = 0;
    rep(k, 1, n) {
        mx = mxm(mx, a[k]);
        preSum += a[k];
        h += preSum;
        print(k*mx + h);
    }
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    #ifdef PRE
        pre();
    #endif
    #ifdef MULTI_CASES
        int t; cin >> t;
        while (t--) solve();
    #else
        solve();
    #endif
    return 0;
}
#include<iostream>
using namespace std;
long n,a[200020],rui[200020];
main()
{
	cin>>n;
	for(int i=0;i<n;i++)cin>>a[i],rui[i]=i==0?a[i]:a[i]+rui[i-1];
	long ans=0,M=0;
	for(int i=0;i<n;i++)M=max(M,a[i]),ans+=rui[i],cout<<(ans+M*(i+1))<<'\n';
}