#!/usr/bin/env python3

# Generated by https://github.com/kyuridenamida/atcoder-tools

from typing import *

import collections

import itertools

import math

import sys



INF = float('inf')





def solve(N: int, A: "List[int]"):

    c = collections.Counter(A+[i+1 for i in range(N)])

    return "\n".join([f'{c[i+1]-1}' for i in range(N)])





def main():



    sys.setrecursionlimit(10 ** 6)



    def iterate_tokens():

        for line in sys.stdin:

            for word in line.split():

                yield word

    tokens = iterate_tokens()

    N = int(next(tokens))  # type: int

    A = [int(next(tokens)) for _ in range(N - 2 + 1)]  # type: "List[int]"

    print((solve(N, A)))





if __name__ == '__main__':

    main()

#!/usr/bin/env python3

# Generated by https://github.com/kyuridenamida/atcoder-tools

from typing import *

import collections

import itertools

import math

import sys



INF = float('inf')





def solve(N: int, A: "List[int]"):

    c = collections.Counter(A)

    return "\n".join([f'{c[i+1]}' for i in range(N)])





def main():



    sys.setrecursionlimit(10 ** 6)



    def iterate_tokens():

        for line in sys.stdin:

            for word in line.split():

                yield word

    tokens = iterate_tokens()

    N = int(next(tokens))  # type: int

    A = [int(next(tokens)) for _ in range(N - 2 + 1)]  # type: "List[int]"

    print((solve(N, A)))





if __name__ == '__main__':

    main()

#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import itertools
import math
import sys

INF = float("inf")


def solve(N: int, A: "List[int]"):
    c = collections.Counter(A + [i + 1 for i in range(N)])
    return "\n".join([f"{c[i+1]-1}" for i in range(N)])


def main():
    sys.setrecursionlimit(10**6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N - 2 + 1)]  # type: "List[int]"
    print((solve(N, A)))


if __name__ == "__main__":
    main()

#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import itertools
import math
import sys

INF = float("inf")


def solve(N: int, A: "List[int]"):
    c = collections.Counter(A)
    return "\n".join([f"{c[i+1]}" for i in range(N)])


def main():
    sys.setrecursionlimit(10**6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N - 2 + 1)]  # type: "List[int]"
    print((solve(N, A)))


if __name__ == "__main__":
    main()

-    c = collections.Counter(A + [i + 1 for i in range(N)]) -    return "\n".join([f"{c[i+1]-1}" for i in range(N)]) +    c = collections.Counter(A) +    return "\n".join([f"{c[i+1]}" for i in range(N)])