https://dojang.io/mod/page/view.php?id=2398
https://infinitt.tistory.com/78
https://gilu-world.tistory.com/40
print("1-1칸","1-2칸","1-3칸",end = "")
print("2-1칸","2-2칸","2-3칸",sep = "")
from sys import stdin
n = int(stdin.readline())
data = list(map(int, stdin.readline().split()))
m = int(stdin.readline())
target = list(map(int, stdin.readline().split()))
count = dict()
for i in data:
try: count[i] += 1
except: count[i] = 1
for i in target:
try: print(str(count[i]), end = " ") # 한 줄에 출력 가능
except: print("0", end = " ")