_ = input() SC = {} while True: try: S, C = input().split() SC[S] = int(C) except EOFError: break ans = [0] * 8 for c in SC.values(): ans[c] += 1 print("\n".join(str(c) for c in ans))