n = int(eval(input()))

a = input().split()



joshi = {}



for i in range(1, n+1):

    joshi[str(i)] = 0



for i in range(n-1):

    joshi[a[i]] += 1



for key in list(joshi.keys()):

    print((joshi[key]))
n = int(eval(input()))

a = input().split()

 

joshi = {}

 

for i in range(1, n+1):

    joshi[str(i)] = 0

 

for i in range(n-1):

    joshi[a[i]] += 1

 

for ans in list(joshi.values()):

    print(ans)
n = int(eval(input()))
a = input().split()
joshi = {}
for i in range(1, n + 1):
    joshi[str(i)] = 0
for i in range(n - 1):
    joshi[a[i]] += 1
for key in list(joshi.keys()):
    print((joshi[key]))

n = int(eval(input()))
a = input().split()
joshi = {}
for i in range(1, n + 1):
    joshi[str(i)] = 0
for i in range(n - 1):
    joshi[a[i]] += 1
for ans in list(joshi.values()):
    print(ans)

-for key in list(joshi.keys()): -    print((joshi[key])) +for ans in list(joshi.values()): +    print(ans)