문제: https://www.acmicpc.net/problem/10816
from collections import defaultdict # 콜렉션에서 불러옵니다.
d = defaultdict(lambda: 0)
input()
for i in list(map(int, input().split())):
d[i] += 1
input()
for i in list(map(int, input().split())):
if i in d:
print(d[i], end = ' ')
else:
print(0, end = ' ')