#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;

typedef long long ll;
typedef struct pair<ll,int> P;

P a[100001]={};
ll b[100001]={};
vector<int> v[100001];
int n,m;


int main() {
	cin>>n;


	for(int i=1;i<n+1;i++){
		cin>>a[i].first;
		a[i].second=i;
	}
	sort(a,a+n+1);
	ll t=0;
	int p1=n+1;
	for(ll i=n;i>0;i--){
		t+=(ll)a[i].first;
		if(a[i].first!=a[i-1].first){
			p1=min(p1,a[i].second);
			b[p1]+=t-(n+1-i)*(a[i-1].first);
			t=(n+1-i)*(a[i-1].first);
		}
	}

	for(int i=1;i<n+1;++i)cout<<b[i]<<endl;
	return 0;
}
