n=int(input()) tbl={} for _ in range(n): name, col = input().split() tbl[name]=int(col) result = [0]*8 for k,v in tbl.items(): result[v]+=1 for i in range(8): print(result[i])