N = int(eval(input()))

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

result = {}

for i in range(N):

  result[i+1] = 0

for i in range(N-1):

  if A[i] in result:

    result[A[i]] += 1

for i in list(result.values()):

  print(i)
n={i:0 for i in range(int(input()))}

for i in list(map(int,input().split())):

  n[i-1]+=1

[print(i) for i in n.values()]

N = int(eval(input()))
A = list(map(int, input().split()))
result = {}
for i in range(N):
    result[i + 1] = 0
for i in range(N - 1):
    if A[i] in result:
        result[A[i]] += 1
for i in list(result.values()):
    print(i)

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

-N = int(eval(input())) -A = list(map(int, input().split())) -result = {} -for i in range(N): -    result[i + 1] = 0 -for i in range(N - 1): -    if A[i] in result: -        result[A[i]] += 1 -for i in list(result.values()): -    print(i) +n = {i: 0 for i in range(int(input()))} +for i in list(map(int, input().split())): +    n[i - 1] += 1 +[print(i) for i in n.values()]