
#include <bits/stdc++.h>

using namespace std;
#define forn(i, n) for (int i = 0; i < n; i++)
#define re return
#define mp make_pair
#define fi first
#define se second
#define sz(a) (int)a.size()
typedef long long ll;

const ll mod = 1e9 + 7;
ll n, ans[100001];
vector<pair<ll, ll> > a;

int main() {
	iostream::sync_with_stdio(0);
	//freopen("a.in", "r", stdin);
	cin >> n;
	a.resize(n);
	forn (i, n) {
		cin >> a[i].fi;
		a[i].se = i;
	}
	sort(a.begin(), a.end());
	reverse(a.begin(), a.end());
	ll mi = n;
	a.push_back(mp(0, 0));
	forn (i, n) {
		mi = min(mi, a[i].se);
		ans[mi] += (a[i].fi - a[i + 1].fi) * ll(i + 1);
	}
	forn (i, n)
		cout << ans[i] << "\n";
}	