#include<bits/stdc++.h>
#define ll long long
using namespace std;
struct pii {
	int S, F;
} a[100005];
int n, nw;
ll ans[100005];
bool cmp(pii x, pii y) {
	return x.F > y.F || (x.F == y.F && x.S < y.S);
}
int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i ++) scanf("%d", &a[i].F);
	for (int i = 1; i <= n; i ++) a[i].S = i;
	sort(a + 1, a + n + 1, cmp);
	a[n + 1].S = n + 1;
	int nw = a[1].S;
	for (int i = 1; i <= n; i ++, nw = min(nw, a[i].S))
		ans[nw] += 1ll * (a[i].F - a[i + 1].F) * i;
	for (int i = 1; i <= n; i ++) printf("%lld\n", ans[i]);
	return 0;
}