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

int main() {
  int N;
  cin >> N;
  priority_queue<long long> max;
  vector<long long> sum(N);
  long long ans = 0;
  for (int i = 0; i < N; i++) {
    long long a;
    cin >> a;
    max.push(a);
    if (i == 0) {
      sum.at(0) = a;
    }
    else {
      sum.at(i) = sum.at(i - 1) + a;
    }
    ans += sum.at(i);
    cout << ans + max.top() * (i + 1) << endl;
  }
}
#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;
    }
}