#include <iostream>
#include <cstdio>
#include <algorithm>
#define F first
#define S second
using namespace std;
typedef long long ll;
ll n, mn=2e9, cnt, c[100005];
pair<ll, ll> a[100005];
int main() {
	ll i;
	scanf("%lld", &n);
	for(i=1; i<=n; i++) scanf("%lld", &a[i].F), a[i].S=i;
	sort(a+1, a+n+1);
	for(i=n; i; i--) {
		mn = min(mn, a[i].S);
		cnt++;
		if(a[i].F!=a[i-1].F) c[mn] += (a[i].F - a[i-1].F) * cnt;
	}
	for(i=1; i<=n; i++) printf("%lld\n", c[i]);
	return 0;
}