#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int N = 100000 + 10;
ll n, a[N];
ll ans[N];
map <ll, ll> f, id;
map <ll, ll>::iterator it, jt;

int main() {
	cin >> n;
	ll mx = 0, idx = -1;
	f[0] = 0;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
		++f[-a[i]];
		mx = max(mx, a[i]);
	}
	for (int i = n - 1; i >= 0; --i)
		id[a[i]] = i;

	idx = id[mx];
	ll pre = 0;
	for (it = f.begin(); ; ++it) {
		jt = it, ++jt;
		if (jt == f.end()) break;
		ans[idx = min(idx, id[-it->first])] += (it->second + pre) * (-it->first - -jt->first);
		pre += it->second;
	}
	for (int i = 0; i < n; ++i)
		cout << ans[i] << "\n";
	return 0;
}