n = int(input())
a = [0] * n
for i in range(n):
    a[i] = int(input())

cnt = [0] * (n + 1)
for elem in a:
    cnt[elem] += 1
for i in range(1, n + 1):
    cnt[i] += cnt[i - 1]
rec = 0
for i in range(n - 1, -1, -1):
    if a[i] > rec:
        new_rec = a[i]
        for j in range(rec + 1, new_rec + 1):
            print(cnt[j - 1] - (n - 1 - i))
        rec = new_rec
for i in range(rec + 1, n + 1):
    print(0)
