n = int(eval(input()))

a = list(map(int, input().split()))

ans = [0] * n



for i in range(n - 1):

  j = a[i]

  ans[j - 1] += 1



for i in range(n):

  print((ans[i]))
n = int(eval(input()))

a = list(map(int, input().split()))

ans = [0] * n



for i in range(n - 1):

  j = a[i]

  ans[j - 1] += 1



print(("\n".join( map( str, ans))))
n = int(eval(input()))
a = list(map(int, input().split()))
ans = [0] * n
for i in range(n - 1):
    j = a[i]
    ans[j - 1] += 1
for i in range(n):
    print((ans[i]))

n = int(eval(input()))
a = list(map(int, input().split()))
ans = [0] * n
for i in range(n - 1):
    j = a[i]
    ans[j - 1] += 1
print(("\n".join(map(str, ans))))

-for i in range(n): -    print((ans[i])) +print(("\n".join(map(str, ans))))