#include <cstdio>
#include <algorithm>
const int MAXN = 1e5+1;
typedef long long LL;
LL C[MAXN];
struct Node
{
	int num, idx;
	bool operator < (const Node &s) const
	{
		return num!=s.num ? num<s.num : idx<s.idx;
	}
}D[MAXN];
#define min(a,b) ((a)<(b)?(a):(b))
int main()
{
	int N, i, j, idx;
	scanf("%d", &N);
	for(i=1; i<=N; ++i)
		scanf("%d", &D[i].num), D[i].idx = i;
	std::sort(D+1, D+N+1);
	for(i=j=idx=N; i>0; i=j)
	{
		while(j>0 && D[i].num == D[j].num) --j;
		C[idx = min(idx, D[j+1].idx)] += LL(N-j) * (D[i].num - D[j].num);
	}
	for(i=1; i<=N; ++i)
		printf("%lld\n", C[i]);
}