#include <vector>
#include <array>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#include <cassert>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <sstream>

using namespace std;


int main(int argc, char** argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(12);


    int n;
    cin >> n;
    vector<long long> A(n);

    for (int i = 0; i < n; ++i) {
        cin >> A[i];
    }

    long long sum = 0;
    long long pre = 0;
    long long res = 0;
    long long mx = 0;
    for (int i = 0; i < n; ++i) {
        mx = max(mx, A[i]);
        res = mx * (i + 1);
        pre += A[i];
        sum += pre;
        res += sum;
        cout << res << '\n';
    }

    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define int long long
using vec_int = vector<int>;
using P = pair<int,int>;
using T = tuple<int,int,int>;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

int charToInt(char c){
    char zero_num = '0';
    return (int)c - (int)zero_num;
}

void cout_line(vector<int> &a){
    for(int i=0;i<a.size();i++){
        if(i<a.size()-1){
            cout<<a.at(i)<<" ";
        }else{
            cout<<a.at(i)<<endl;
        }
    }
}


signed main(){
    int N; cin>>N;
    vec_int A(N); rep(i,N)cin>>A.at(i);

    vec_int cumul(N+1, 0);
    vec_int max_val(N+1, 0);
    rep(i,N){
        cumul.at(i+1) = cumul.at(i)+ A.at(i);
        max_val.at(i+1) = max(A.at(i), max_val.at(i));
    }

    int prev_ans = 0;

    for(int i=0;i<N;i++){
        int tot_sum = cumul.at(i+1);
        tot_sum += prev_ans;
        tot_sum += (i+1)*max_val.at(i+1);

        cout<<tot_sum<<endl;
        prev_ans = tot_sum-(i+1)*max_val.at(i+1);
    }






    return 0;
}