시과초과 나는 나의 풀이....
count_a = int(input())
nums_a = list(map(int, input().split()))
count_b = int(input())
nums_b = list(map(int, input().split()))
for i in nums_b:
if i not in nums_a:
print(0)
else:
nums_a.remove(i)
print(0)
N, A = int(intpu()), {i: 1 for i in map(int, input().split())}
M = input()
for i in list(map(int, input().split())):
print(A.get(i,0))