

#include <cstdio>
#include <algorithm>
#include <iostream>
using namespace std;
#define X first
#define Y second
typedef long long LL;
typedef pair<int, int> pii;
const int N = 1e5 + 100;

pii a[N];
LL ans[N];
int main() {
    int n;
    cin >> n;
    for(int i = 1; i <= n; i ++) {
        scanf("%d", &a[i].X);
        a[i].Y = -i;
    }
    sort(a + 1, a + 1 + n, greater<pii>() );
    LL sum = 0;
    for(int now = 1, nxt = now; now <= n; now = nxt) {
        while(nxt <= n && a[nxt].Y <= a[now].Y) sum += a[nxt ++].X,
        ans[-a[now].Y] = sum - (nxt - 1) * 1LL * a[nxt].X;
        sum -= ans[-a[now].Y]; 
    }
    for(int i = 1; i <= n; i ++) 
        printf("%lld\n", ans[i]);
}

