#include<stdio.h>
#include<algorithm>
using namespace std;
struct point{
    int x, y;
    bool operator<(const point &p)const{
        return x!=p.x?x<p.x:y<p.y;
    }
}w[101000];
int n;
long long Res[101000];
int main(){
    scanf("%d",&n);
    int i, a=n;
    for(i=1;i<=n;i++){
        scanf("%d",&w[i].x);
        w[i].y = i;
    }
    sort(w+1,w+n+1);
    for(i=n;i>=1;i--){
        a = min(a,w[i].y);
        Res[a] += 1ll*(w[i].x-w[i-1].x)*(n-i+1);
    }
    for(i=1;i<=n;i++)printf("%lld\n",Res[i]);
}