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

int main() {
	int n;
	cin >> n;
	vector<long long> a(n);
	long long mx = -1e9;
	long long sm = 0;
	long long pre = 0, pre_sum = 0;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
		sm += a[i];			
		sm += pre;
		pre += a[i];
		mx = max(mx, a[i]);
		cout << sm + mx * (i + 1) << endl;
	}
}
#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9+7;

template <typename Abel> struct BIT {
    private:
    int n;
    vector<Abel> data;

    public:
    BIT (const int n_) : n(n_+1), data(n+1, 0) {}

    void add(const int i, const Abel x) {
        for(int k = i + 1 ; k < n; k += k & -k) data[k-1] += x;
    }

    Abel sum(int r) {
        Abel ret = data[r-1];
        while(r > 0) ret += data[(r -= r & -r)-1];
        return ret;
    }
    Abel sum(const int l, const int r) {
        return sum(r) - sum(l);
    }

    int lower_bound(Abel w){
        if(w <= 0) return 0;
        int ret = 0, k = 1;
        while(k < n) k <<= 1;
        for(int i = k; i > 0; i >>= 1){
            assert(typeid(w) == typeid(int) || typeid(w) == typeid(long long));
            if(ret+i/*-1*/ < n && data[ret+i-1] < w) w -= data[(ret+=i)-1];
        }
        return ret;
    }
    int upper_bound(const Abel w){
        return lower_bound(w + 1);
    }

    void print(){
        for(int i = 0; i < n - 1; i++) cout << sum(i, i+1) << ' ';
        cout << endl;
    }
};

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);

    int n;
    cin >> n;

    vector<long long> a(n);
    vector<long long> mx(n, -1);
    cin >> a[0];
    mx[0] = a[0];
    for(int i = 1; i < n; i++){
        cin >> a[i];
        mx[i] = max(mx[i-1], a[i]);
    }

    long long ans = 0;
    long long tmp = 0;
    cout << a[0]*2 << endl;
    ans += a[0]+mx[0];
    tmp = a[0]+mx[0];
    for(int i = 1; i < n; i++){
        tmp += mx[i]-mx[i-1];
        ans += tmp + a[i];
        tmp = tmp+a[i];
        ans += max(i*(mx[i]-mx[i-1]), 0LL);
        cout << ans << " " << endl;
    }

    return 0;
}