#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0,endrep=(n); i<endrep; ++i)
#define rep1(i,n) for(ll i=1,endrep=(n); i<=endrep; ++i)
#define revrep(i,n) for(ll i=(ll)(n)-1; i>=0; --i)
inline constexpr ll Inf = (1ULL << 60) -123456789;
#define fastio cin.tie(0); ios_base::sync_with_stdio(false); cout<<fixed<<setprecision(10);
#define newl '\n'
#define YN(e) ((e)?"Yes":"No")
#define all(a) begin(a),end(a)
#define rall(a) rbegin(a),rend(a)
#define delif(c,pred) (c).erase(remove_if(all(c),(pred)), end(c))
template <class T,class U> bool updmax(T& a, U b) { if(b>a){ a=b; return true;} return false;}
template <class T,class U> bool updmin(T& a, U b) { if(b<a){ a=b; return true;} return false;}
inline constexpr int Mod = 1000000007;
//inline constexpr int Mod = 998244353;
#define dbg(a) cerr << #a << ": " << a << endl;
#define dbgs(s) cerr << #s << endl;
#define dbg1(a,n) cerr<<#a<<": "; rep(i,n) cerr<<a[i]<<" "; cerr<<endl;
#define dbg2(m,h,w) cerr<<#m<<":"<<endl; rep(i,h){ rep(j,w)cerr<<m[i][j]<<" "; cerr<<endl; }
template <class T, class U> ostream& operator << (ostream& os, pair<T,U> v) {os<<v.first<<","<<v.second;return os;}
template <class T, size_t N> ostream& operator << (ostream& os, array<T,N> v) {rep(i,N)os<<v[i]<<(i+1<(ll)N?" ":"");return os;}
int rng(int n) { return rand()/(RAND_MAX+1.0)*n; }

int main() {
    fastio;
    ll N;
    cin >> N;
    vector<ll> a(N),s(N),m(N);
    rep(i,N) cin >> a[i];
    rep(i,N) s[i] = a[i] + (i?s[i-1]:0);
    rep(i,N) s[i] += (i?s[i-1]:0);
    rep(i,N) m[i] = max(a[i], (i?m[i-1]:0));
    rep(k,N) {
        ll ans = s[k] + m[k]*(k+1);
        cout << ans << newl;
    }
}

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main(){
    int64_t N;
    cin >> N;
    vector<int64_t> A(N);
    vector<int64_t> B(N);
    vector<int64_t> max(N);
    vector<int64_t> sum(N);
    vector<int64_t> total(N);
    for(int i=0;i<N;i++){
        cin >> A[i];
        if(i==0){
            max[i]=A[i];
            sum[i]=A[i];
            total[i]=A[i];
        }else{
            if(max[i-1]<A[i]){
                max[i]=A[i];
            }else{
                max[i]=max[i-1];
            }
            sum[i]=sum[i-1]+A[i];
            total[i]=total[i-1]+sum[i];
        }
    }
    for(int i=0;i<N;i++){
        int64_t ans=sum[i];
        int64_t m=max[i];
        ans=ans+m*(i+1);
        if(i>0){
            ans=ans+total[i-1];
        }
        cout << ans << endl;
    }
    

}