import sys
index = 0
he = set()
sunhe = []
d = {"Invalid":0}
for line in sys.stdin:
a = line.split("\n")[0]
if index == 1:
aa = a.split(" ")
[sunhe.append(_) for _ in aa]
he = set(sunhe)
if index == 3:
aa = a.split(" ")
for _ in aa:
if _ in he:
if _ not in d:
d[_]=0
d[_]+=1
else:
d["Invalid"]+=1
index += 1
for k in sunhe:
print("%s : %s" % (k,d.get(k,0)))
print("%s : %s" % ("Invalid",d.get("Invalid",0)))

京公网安备 11010502036488号