
// C++ (GCC9.2.1) AtCoder
/*
Ctrl+Option+N で　実行

*/

#include <bits/stdc++.h>
#define INF 100000000000
#define MOD 1000000007
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define print(x) cout << (x) << endl;

typedef long long ll;

using namespace std;


int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr); 
  ll N;
  cin>>N;
  vector <ll> A(N+1);
  REP(i,N) cin>>A[i+1];

  ll ruiseki = 0;

  vector <ll> ans(1+N,0);

  ans[1] = A[1] + A[1];
  ruiseki += A[1];
  ll ma = A[1];

  for(int i=1;i<N;i++){
    ruiseki += A[i+1];
    ll pma = ma;
    ma = max(ma,A[i+1]);
    ans[i+1] = ruiseki + (i+1) * ma - i * pma + ans[i];
  }  

  for(int i=1;i<=N;i++) print(ans[i])




  return 0;
}
#include <bits/stdc++.h>
using namespace std;

long long A[200005];

int main() {
    ios::sync_with_stdio(0);
    cin.tie(NULL), cout.tie(NULL);
    
    int n;
    cin >> n;
    
    long long maxx = 0, sum = 0, pre = 0;
    
    for (int i=1; i<=n; i++)
    {
        cin >> A[i];
        
        maxx = max(maxx, A[i]);
        sum += A[i];
        pre += sum;
        
        cout << maxx * i + pre << "\n";
    }
    
    return 0;
}
