#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stdlib.h>
#include <time.h>
#include <iomanip>
#include <math.h>
#include <bitset>

using namespace std;

#define taskname "A"
#define LL long long 
#define uLL unsigned long long 
#define FOR(i,l,r) for(int i = l; i <= r; ++i)
#define REP(i,l,r) for(int i = l; i < r; ++i)
#define FORD(i,r,l) for(int i = r; i >= l; --i)
#define REPD(i,r,l) for(int i = r; i > l; --i)
#define pi pair<int,int>
#define pii pair<int,pi>
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define _USE_MATH_DEFINES 
/* M_PI */

const int maxN = 2e5 + 11;
const LL oo = 1e17 + 11;

int tcases = 1;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
char ch;
int readInt(){
    bool fl = 0;
    while(ch = getchar(),ch != '-' && (ch < '0' || ch > '9'));
    if(ch == '-'){
        fl = 1;
        while(ch = getchar(),ch < '0' || ch > '9');
    }
    int r = ch - '0';
    while(ch = getchar(),ch >= '0' && ch <= '9') r = r * 10 + (ch - '0');
    return fl ? -r : r;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////

int N,M,K,C[maxN];
LL A[maxN],res[maxN];

bool cmp(int i,int j){
    return A[i] == A[j] ? i < j : A[i] > A[j];
}
void testcase(){
    cin >> N;
    FOR(i,1,N) cin >> A[i],C[i] = i;
    sort(C + 1,C + 1 + N,cmp);
    //
    int first = 1;
    int curpos = C[1];

    while(first <= N){
        int last = first;
        while(last < N && A[C[last + 1]] == A[C[last]]) ++last;
        if(last >= N){
            res[curpos] += A[C[first]] * last;
            break;
        }else res[curpos] += (A[C[first]] - A[C[last + 1]]) * last;
        //
        first = last + 1;
        curpos = min(curpos,C[first]);
    }
    FOR(i,1,N) cout << res[i] << endl;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie();
    cout.tie();
    //

    //cin >> tcases;

    FOR(i,1,tcases) testcase();

    return 0;
}