_ = input() ss = {} cs = {} while True: try: S, C = input().split() ss[S] = int(C) except EOFError: break for s, c in ss.items(): cs.setdefault(c, 0) cs[c] += 1 for i in range(8): print(cs[i])