#include <bits/stdc++.h>

using namespace std;
#define ll long long
ll n;
map<ll, ll> m , kq , idx;
int main()
{
    cin >> n;
    for(int i = 1;i <= n;i++){
        ll foo; cin >> foo;
        m[foo]++;
        if(!idx.count(foo)) idx[foo] = i;
    }
    map<ll , ll>::iterator it;
    ll pre = 0 , cnt = 0;
    for(it = --m.end();; it--){
        if(pre == 0){
            pre = it->first;
            cnt = it->second;
            continue;
        }
        kq[idx[pre]] = (pre - it->first) * cnt;
        pre = it->first;
        cnt += it->second;
        if(it == m.begin()) break;
    }
    kq[idx[pre]] = cnt;
    for(int i = 1;i <= n;i++)
        cout << kq[i] << "\n";
    return 0;
}
