n=int(eval(input()))

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

from collections import *

c=Counter(l)

for i in range(n): print((c[i+1]))
n=int(eval(input()))

from collections import *

c=Counter(list(map(int,input().split())))

for i in range(n): print((c[i+1]))
n = int(eval(input()))
l = list(map(int, input().split()))
from collections import *

c = Counter(l)
for i in range(n):
    print((c[i + 1]))

n = int(eval(input()))
from collections import *

c = Counter(list(map(int, input().split())))
for i in range(n):
    print((c[i + 1]))

-l = list(map(int, input().split())) -c = Counter(l) +c = Counter(list(map(int, input().split())))