#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
int n; ll a[100009], b[100009], s[100009], ret[100009];
int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) scanf("%lld", &a[i]), b[i] = a[i];
	sort(b, b + n + 1);
	for (int i = 0; i < n; i++) s[i + 1] = s[i] + (b[i + 1] - b[i]) * (n - i);
	vector<ll> l; l.push_back(0);
	for (int i = 1; i <= n; i++) {
		if (a[l.back()] < a[i]) l.push_back(i);
	}
	for (int i = 1; i < l.size(); i++) {
		int ptl = lower_bound(b, b + n, a[l[i - 1]]) - b;
		int ptr = lower_bound(b, b + n, a[l[i]]) - b;
		ret[l[i]] = s[ptr] - s[ptl];
	}
	for (int i = 1; i <= n; i++) printf("%lld\n", ret[i]);
	return 0;
}