// Slower C++ solution:
#include<bits/stdc++.h>

#define int ll

//{ PXH612

using namespace std;

#define ll long long

#define db double

#define pp pair<int,int>

#define x first

#define y second



#define false(x) if(!(x))

template<typename A,typename B>bool Min(A &a,B b){if(a<=b) return 0;a=b;return 1;}

template<typename A,typename B>bool Max(A &a,B b){if(a>=b) return 0;a=b;return 1;}

#define in ({ll x=0;int o=0,c=char(),t=0;for(;!isdigit(c)&&t<1000;c=getchar(),t++) o=c=='-';for(;isdigit(c);c=getchar()) x=x*10+c-'0';o?-x:x;})

#define inchar ({char c=getchar();while(c==' '||c=='\n') c=getchar();c;})



#define FOR(i,a,b) for(int i=a,ENDFOR=b;i<=ENDFOR;i++)

#define ROF(i,a,b) for(int i=b,ENDFOR=a;ENDFOR<=i;i--)

#define RR(x,a,b) {cout<<#x<<": ";FOR(_,a,b) cout<<x[_]<<" ";cout<<"\n";}

#define rr(x) " "<<#x<<'='<<(x)<<" "



#define VEC(i,a) for(auto&i:a)

#define pb push_back

#define vn(a) (int)a.size()-1



#define bit(x,i) ((x>>(i-1))&1ll)

#define on(x,i) (x|(1ll<<(i-1)))

#define off(x,i) (x&~(1ll<<(i-1)))

#define mu(x) (1ll<<x)

#define bitnum(x) __builtin_popcountll(x)



#define segg(a,b) (abs(a-b)+1)

#define midd(a,b) (a+(b-(a))/2)

#define mems(x,a) memset(x,a,sizeof x)

#define open(a) freopen(a,"r",stdin)

#define shut(b) freopen(b,"w",stdout)

//}/////////////////////////////////////////////////////}



const int N=1e5+5;

int n;

int a[N],ans[N];

vector<int> e[N],v;



int low(int x){return lower_bound(v.begin(),v.end(),x)-v.begin();}

main()

{

  // open("frequency.inp");

    n=in;

    FOR(i,1,n) a[i]=in;

    FOR(i,1,n) v.pb(a[i]);



    v.pb(0);



    sort(v.begin(),v.end());

    v.erase(unique(v.begin(),v.end()),v.end());

    FOR(i,1,n) e[low(a[i])].pb(i);



    int cnt=0,mn=INT_MAX;

   // cout<<rr(v[0]) rr(v[1]) "\n";

    ROF(i,1,vn(v)) if(e[i].size())

    {

        VEC(j,e[i]) Min(mn,j);

        cnt+=e[i].size();

        ans[mn]+=cnt*(v[i]-v[i-1]);

    }

    FOR(i,1,n) cout<<ans[i]<<"\n";

}


// Faster C++ solution for the same problem (measured speedup: 3.3582541388453135x):
// #pragma GCC optimize("Ofast")

// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")

// #pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>



#define FAST std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

#define DECIMAL(n)  std::cout << std::fixed;std::cout << std::setprecision(n);

#define hell 1000000007

#define narak 998244353

#define PI 3.14159265358979323844

#define mp make_pair

#define eb emplace_back

#define pb push_back

#define fi first 

#define se second

#define all(v) v.begin(), v.end()

#define endl "\n"

#define sqr(a) (a)*(a)

#define __lcm(m,n) m*(n/__gcd(m,n))

#define inputarr(a,n) for(int xxx=0;xxx<n;++xxx) cin>>(a)[xxx]

#define sz(a) (int)a.size()

#define sl(a) (int)a.length()

#define display(x) for(auto &a:x) cout<<a<<" ";cout<<endl

#define debug cerr<<"bhau"<<endl

#define between(n,a,b) (a<=n&&n<=b)

#define elasped_time 1.0 * clock() / CLOCKS_PER_SEC 



#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)

template <typename Arg1>

void __f(const char* name, Arg1&& arg1){

    std::cerr << name << " : " << arg1 << endl;

}

template <typename Arg1, typename... Args>

void __f(const char* names, Arg1&& arg1, Args&&... args){

    const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);

}





template<typename T, typename U> static inline void amin(T &x, U y) { 

    if (y < x) 

        x = y; 

}



template<typename T, typename U> static inline void amax(T &x, U y) { 

    if (x < y) 

        x = y; 

}



template<typename T,typename U> std::ostream& operator<<(std::ostream& out, std::pair<T,U> a) {

    out<<a.fi<<" "<<a.se;

    return out;

}



template<typename T,typename U> std::istream& operator>>(std::istream& in, std::pair<T,U> &a) {

    in>>a.fi>>a.se;

    return in;

}



inline long long toint(const std::string &s) {std::stringstream ss; ss << s; long long x; ss >> x; return x;}

inline std::string tostring(long long number) {std::stringstream ss; ss << number; return ss.str();}

inline std::string tobin(long long x) {return std::bitset<63>(x).to_string();}



std::mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());



#define ll long long

#define pii std::pair<int, int>

#define vi vector<int>  

#define vvi vector<vi > 

#define vii vector<pii >

#define point complex<ll>

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 



/*----------------------Graph Moves----------------*/

//const int fx[]={+1,-1,+0,+0};

//const int fy[]={+0,+0,+1,-1};

//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move

//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move

//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move

//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move

/*------------------------------------------------*/



//primes for hashing 937,991,1013,1409,1741



using namespace std;

using namespace __gnu_pbds;

#define int long long

void meowmeow321()

{

    int n;

    cin>>n;

    int a[n];

    inputarr(a,n);

    vii dog;

    for (int i = 0; i < n; ++i) {

    	dog.eb(a[i],i+1);

    }

    dog.eb(0,0);

    sort(all(dog),greater<pii>());

    int ans[n+1]={};

    int val=dog[0].fi;

    int mn=dog[0].se;

    int cnt=1;

    for (int i = 1; i < sz(dog); ++i) {

    	if(dog[i].fi<dog[i-1].fi){

    		ans[mn]+=cnt*(dog[i-1].fi-dog[i].fi);

    		val=dog[i].fi;

    	}

		cnt++;

		amin(mn,dog[i].se);

    }

    for (int i = 0; i < n; ++i) {

    	cout<<ans[i+1]<<endl;

    }

}

signed main()

{

    FAST;

    int testcases=1;

    //cin>>testcases;

    for(int i=0;i<testcases;++i)

    {

        meowmeow321();

    }

    cerr<<endl<<"Time Elasped : "<<elasped_time<<endl;

    return 0;

}