#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll,int> P;
const int MAX_N=1e5+4;
const int INF=1e9+7;
ll a[MAX_N];
P b[MAX_N];
ll ans[MAX_N];
vector<int> IS;
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){cin>>a[i+1];b[i+1]=P(a[i+1],i+1);}
	sort(b,b+n+1);
	int mi=INF;
	for(int i=n;i>=1;i--){
		mi=min(mi,b[i].second);
		ans[mi]+=(n+1-i)*(b[i].first-b[i-1].first);
	}
	for(int i=0;i<n;i++)cout<<ans[i+1]<<endl;
}
