#include<algorithm>
#include<iostream>
#include<cstdio>
#define MN 100000
using namespace std;
inline int read()
{
    int x=0;char ch=getchar();
    while (ch<'0'||ch>'9')ch=getchar();
    while (ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar();
    return x;
}
int n,a[MN+5],rk[MN+5];long long ans[MN+5];
bool cmp(int x,int y){return a[x]>a[y];}
int main()
{
    n=read();
    for(int i=1;i<=n;++i) a[i]=read(),rk[i]=i;
    sort(rk+1,rk+n+1,cmp);
    for(int i=1,j,now=1e9;i<=n;i=j)
    {
        for(j=i;j<=n&&a[rk[j]]==a[rk[i]];++j) now=min(now,rk[j]);
        ans[now]+=1LL*(j-1)*(a[rk[i]]-a[rk[j]]);
    }
    for(int i=1;i<=n;++i) printf("%lld\n",ans[i]);
    return 0;
}
