_ = 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 [str(c) for c in ans].join(sep="\n")