#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for(int i = x; i < (int)(n); ++i)

ll an[100001];

int main(){
	int n;
	scanf("%d", &n);
	priority_queue<pair<int, int> > q;
	q.push(make_pair(0, 0));
	f(i, 1, n + 1){
		int t;
		scanf("%d", &t);
		q.push(make_pair(t, i));
	}
	int l = q.top().first, v = q.top().second, s = 1;
	q.pop();
	while (!q.empty()){
		int d = l - q.top().first;
		an[v] += (ll)d * s;
		++s;
		l = q.top().first;
		v = min(v, q.top().second);
		q.pop();
	}
	f(i, 1, n + 1)printf("%lld\n", an[i]);
}
