#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string.h>
using namespace std;
int n,ans[100005],i,j,k,l,m,c[100005];
struct node{
	int a,b;
}s[100005];
int cmp(node x,node y){
	if(x.b==y.b) return x.a<y.a;
	return x.b<y.b;
}
int main(){
	memset(ans,0,sizeof(ans));
	scanf("%d",&n);
	for(i=1;i<=n;i++) scanf("%d",&s[i].b),s[i].a=i,c[i]=s[i].b;
	sort(s+1,s+n+1,cmp);
	j=0,c[n+1]=0;
	for(i=1;i<=n;i++){
		while(c[i]<=j) i++;
		if(i>n) break;
		for(k=1;;k++) if(s[k].b==c[i]) break;
		for(l=1;;l++) if(s[l].b>=j+1) break;
		ans[i]=(s[k].b-s[k-1].b)*(n-k+1);
		if(c[i]>j+1&&l<k){
			for(m=l;m<k;m++) ans[i]+=s[m].b;
			ans[i]+=(n-k+1)*s[k-1].b;
		}
		j=c[i];
	}
	for(i=1;i<=n;i++) printf("%d\n",ans[i]);
	return 0;
}