#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
struct node{
    long long val,id;
    friend bool operator <(node b,node c){if(b.val<c.val) return true;if(b.val==c.val&&b.id<c.id) return true;return false;}
}a[100050];
long long n,ans[100050],num[100050];
int main(){
    scanf("%lld",&n);
    for(long long i=1;i<=n;i++){scanf("%lld",&a[i].val);a[i].id=i;num[i]=a[i].val;}
    sort(a+1,a+n+1);
    for(long long i=1,j=0;i<=n;i++){
    	while(a[i].val>num[j]) j++;
        ans[j]+=(a[i].val-a[i-1].val)*(n-i+1);
    }
    for(long long i=1;i<=n;i++) printf("%lld\n",ans[i]);
    return 0;
}
