import std.algorithm;
import std.range;
import std.math;
import std.regex;
import std.array;
import std.container;
import std.stdio;
import std.string;
import std.conv;
import std.traits;
import std.typecons;


void main()
{
    writefln("%(%s\n%)", solve());
}


ulong[] solve()
{
    int N = readInt;
    auto list = readInts.enumerate(cast(size_t)1).array();

    list.sort!"a.value > b.value"();
    Entry[] entries;
    foreach(e; list){
        if(entries.length == 0)
            entries ~= Entry(e.value, e.index, 1);
        else if(entries[$-1].value == e.value){
            entries[$-1].minIdx = min(entries[$-1].minIdx, e.index);
            entries[$-1].cnt += 1;
        }
        else
            entries ~= Entry(e.value, e.index, 1);
    }

    // writeln(entries);

    ulong[] result = new ulong[N];
    auto M = entries.length;
    foreach(i; 0 .. M){
        // writeln(entries);
        // writeln(result);
        // writeln();

        if(i != M-1){
            int diff = entries[i].value - entries[i+1].value;
            auto idx = entries[i].minIdx;
            result[idx-1] += diff * entries[i].cnt;

            entries[i+1].minIdx = min(entries[i+1].minIdx, idx);
            entries[i+1].cnt += entries[i].cnt;
        }else{
            int diff = entries[i].value;
            auto idx = entries[i].minIdx;
            result[idx-1] += diff * entries[i].cnt;
        }
    }


    return result;
}


struct Entry
{
    int value;
    size_t minIdx;
    size_t cnt;
}



string[] readStrs() { return readln.chomp.split(' '); }
T[] readInts(T = int)() { return readStrs.map!(to!T).array(); }
T readInt(T = int)() { return readln.chomp.to!T; }
Tuple!Ts readTuple(Ts...)()
{
    auto ss = readStrs();
    typeof(return) dst;
    foreach(i, U; Ts)
        dst[i] = ss[i].to!U;

    return dst;
}

struct ModIntT(T = int, T MOD = 1_000_000_007)
if(isIntegral!T)
{
    alias value this;
    T value;


    this(U)(U u)
    if(isIntegral!U)
    {
        value = cast(T)(u % MOD);
    }


    ModInt opBinary(string op, U)(U u)
    if(op == "+" || op == "-" || op == "*" || op == "/")
    {
      static if(is(U : typeof(this)))
      {
        static if(op == "+")
          return typeof(this)((this.value + u.value));
        else static if(op == "-")
          return typeof(this)((this.value + MOD - u.value));
        else static if(op == "*")
          return typeof(this)((cast(long)this.value * cast(long)u.value));
        else static if(op == "/")
          return u^^(MOD-2) * this.value;
        else static assert(0);
      }
      else static if(isIntegral!U)
        return this.opBinary!op(typeof(this)(u));
      else static assert(0);
    }


    ModInt opBinary(string op : "^^", U)(U u)
    if(isIntegral!U)
    {
        if(u == 0) return ModInt(1);
        else if(u % 2 == 0){
            long d = cast(long)this.opBinary!"^^"(u / 2);
            return ModInt(d * d);
        }else
            return ModInt((cast(long)this) * cast(long)this.opBinary!"^^"(u-1));
    }


    string toString() { return value.to!string; }

    U opCast(U)() { return cast(U)value; }

    void opAssign(U)(U u) if(isIntegral!U) { value = u % MOD; }
}


alias ModInt = ModIntT!int;
alias ModLong = ModIntT!long;

unittest
{
    enum MOD = 1_000_000_007;

    ModInt a = 123;
    assert(a.value == 123);

    a = MOD - 1;
    ModInt b = a;

    long v = MOD-1;
    assert((a * a).value == (v * v) % MOD);
    assert((a + a).value == (v + v) % MOD);
    assert((a - a).value == (v - v) % MOD);
    assert((a - a).value == (v - v) % MOD);
    assert((a^^2).value == (v^^2) % MOD);
    a = 10;
    v = 10;
    assert((a^^10).value == (v^^10) % MOD);
    assert(((a^^10)/10).value == (v^^9) % MOD);
    a = 2;
    v = 2;
    assert((a^^40).value == (v^^40) % MOD);
    assert(((a^^40)/2).value == (v^^39) % MOD);
}

pure bool isPrime(T)(T src)
if(isIntegral!T)
{
    if(src <= 1)return false;
    else if(src < 4)return true;
    else if(!(src&1))return false;
    else if(((src+1)%6) && ((src-1)%6))return false;
    
    T root = cast(T)sqrt(cast(float)src) + 1;
    
    for(T i=5;i<root;i+=6)
        if(!((src%i) && ((src)%(i+2))))
            return false;

    return true;
}


Measured memory_bytes: 10812