N = int(eval(input()))

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



subordinates = [0] * (N + 1)

for boss in bosses:

  subordinates[boss] += 1

  

for count in subordinates[1:]:

  print(count)
N = int(eval(input()))

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



subordinates = [0] * (N + 1)

for boss in bosses:

  subordinates[boss] += 1



print(("\n".join(map(str, subordinates[1:]))))

N = int(eval(input()))
bosses = list(map(int, input().split()))
subordinates = [0] * (N + 1)
for boss in bosses:
    subordinates[boss] += 1
for count in subordinates[1:]:
    print(count)

N = int(eval(input()))
bosses = list(map(int, input().split()))
subordinates = [0] * (N + 1)
for boss in bosses:
    subordinates[boss] += 1
print(("\n".join(map(str, subordinates[1:]))))

-for count in subordinates[1:]: -    print(count) +print(("\n".join(map(str, subordinates[1:]))))