//Har Har Mahadev
using namespace std;
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#ifdef bhole_ka_saaya
	#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
	#define booga cerr << "booga" << endl
#else
	#define debug(...) ;
	#define booga ;
#endif

template <typename T> std::ostream& operator<<(std::ostream& stream, const vector<T>& vec){ for(int x : vec)stream << x << ' '; return stream; }
template <typename T> std::istream& operator>>(std::istream& stream, vector<T>& vec) { for(int &x : vec)stream >> x;return stream; }
template <typename T> void operator+=(vector<T>& vec, const T value) { for(int &x : vec)x += value; }
template <typename T> void operator-=(vector<T>& vec, const T value) { for(int &x : vec)x -= value; }
template <typename T> void operator++(vector<T>& vec) { vec += 1; }
template <typename T> void operator++(vector<T>& vec,T) { vec += 1; }
template <typename T> void operator--(vector<T>& vec) { vec -= 1; }
template <typename T> void operator--(vector<T>& vec,T) { vec -= 1; }
template <typename T> void operator*=(vector<T>& vec, const T value) { for(int &x : vec)x *= value; }
template <typename T> void operator/=(vector<T>& vec, const T value) { for(int &x : vec)x /= value; }

template <typename A, typename B>string to_string(pair<A, B> p);
template <typename A, typename B, typename C>string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>string to_string(tuple<A, B, C, D> p);
string to_string(const string& s) { return '"' + s + '"'; }
string to_string(char c) {string s;s += c;return s; }
string to_string(const char* s) {return to_string((string) s); }
string to_string(bool b) {return (b ? "1" : "0"); }
string to_string(vector<bool> v) {bool first = true;string res = "{";for (int i = 0; i < static_cast<int>(v.size()); i++) {if (!first) {res += ", ";}first = false;res += to_string(v[i]);}res += "}";return res;}
template <size_t N>string to_string(bitset<N> v) {string res = "";for (size_t i = 0; i < N; i++) {res += static_cast<char>('0' + v[i]);}return res;}
template <typename A>string to_string(A v) {bool first = true;string res = "{";for (const auto &x : v) {if (!first) {res += ", ";}first = false;res += to_string(x);}res += "}";return res;}
template <typename A, typename B>string to_string(pair<A, B> p) {return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}
template <typename A, typename B, typename C>string to_string(tuple<A, B, C> p) {return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";}
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";}
template <typename T> void ckmin(T& change, T val){change = min(change,val);}
template <typename T> void ckmax(T& change, T val){change = max(change,val);}

void debug_out() { cerr << endl; } template <typename Head, typename... Tail>void debug_out(Head H, Tail... T) {cerr << " " << to_string(H);debug_out(T...);}
void bharo(int N_N) { return; }template <typename Head, typename... Tail>void bharo(int N_N, Head &H, Tail & ... T) {H.resize(N_N);bharo(N_N,T...);}
void safai() { return; }template <typename Head, typename... Tail>void safai(Head &H, Tail & ... T) {H.clear();safai(T...);}

void testcase(){
	int n;
	cin >> n;
	vector<ll> a(n);
	for(int i = 0; i < n; i++){
		cin >> a[i];
	}
	ll lar = -1,sum = 0,here = 0;
	for(int i = 0; i < n; i++){
		ckmax(lar,a[i]);
		sum += a[i];
		here += sum;
		cout << here + lar*(ll)(i+1) << '\n';
	}
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int tt = 1;
	//cin >> tt;
	while(tt--){
		testcase();
	}
	return 0;
}


#include <cstdio>

#define uint unsigned int
#define i64 long long
#define u64 unsigned i64

int Max(int a, int b) { return (a > b) ? a : b; }
int Min(int a, int b) { return (a < b) ? a : b; }

int rint()
{
	int x = 0, fx = 1; char c = getchar();
	while (c < '0' || c > '9') { fx ^= (c == '-' ? 1 : 0); c = getchar(); }
	while ('0' <= c && c <= '9') { x = (x << 3) + (x << 1) + (c ^ 48); c = getchar(); }
	if (!fx) return -x;
	return x;
}

const int MAX_n = 2e5;

int n, v[MAX_n + 5];
int maxv[MAX_n + 5];

i64 dp[MAX_n + 5];
i64 sum[MAX_n + 5];

int main()
{
	n = rint();
	for (int i = 1; i <= n; i++)
	{
		v[i] = rint();
		sum[i] = sum[i - 1] + v[i];
		maxv[i] = Max(maxv[i - 1], v[i]);
		dp[i] = dp[i - 1] + sum[i];
		printf("%lld\n", dp[i] + 1LL * maxv[i] * i);
	}
	return 0;
}
