#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

// AtCoder
// #include <atcoder/all>
// using namespace atcoder;

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...)
#endif

#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define reprev_(i, a_, b_, a, b, ...) for (int i = (b)-1, i##_min = (a); i >= i##_min; --i)
#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(x) (x).begin(), (x).end()
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
#define fls(x) (64 - __builtin_clzll(x))
#define pcnt(x) __builtin_popcountll(x)
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

int main (void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<ll> a(n), m(n); rep (i, n) cin >> a[i];
    partial_sum(all(a), m.begin(), [](ll a, ll b){return max(a, b);});
    partial_sum(all(a), a.begin());
    partial_sum(all(a), a.begin());
    rep (i, n) cout << a[i] + m[i] * (i + 1) << '\n';
    return 0;
}
#include <bits/stdc++.h>

using namespace std;
const int nxm = 2e5 + 10;
long long n, a[nxm], Max, s1[nxm], s2[nxm];
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    for(int i = 1; i <= n; i++)
    {
        cin >> a[i];
        s1[i] = s1[i - 1] + a[i];
    }
    for(int i = 1; i <= n; i++)
        s2[i] = s2[i - 1] + s1[i];
    Max = a[1];
    for(int i = 1; i <= n; i++)
    {
        Max = max(Max, a[i]);
        cout << 1ll*(s1[i] + i*Max + s2[i - 1]) << "\n";
    }
    return 0;
}
