#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int maxn = 1e5 + 100;

int n;

pair<ll, int> a[maxn];

ll p[maxn];

int main(){
    #ifdef ONPC
    ifstream cin("a.in");
    ofstream cout("a.out");
    #endif
    ios::sync_with_stdio(0);
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> a[i].first, a[i].second = i;
    sort(a, a + n);
    reverse(a, a + n);
    ll sum = 0;
    for (int i = 0; i < n; i++)
        p[a[i].second] = sum - a[i].first * i, sum += a[i].first;
    ll mx = 0;
    for (int i = 0; i < n; i++){
        p[i] = sum - p[i];
        if (mx >= p[i])
            cout << 0;
        else
            cout << p[i] - mx, mx = p[i];
        cout << '\n';
    }
}
