n = int(input()) list = [0, 0, 0, 0, 0, 0, 0, 0] for i in range(n): s, cc = input().split() c = int(cc) list[c] += 1 for i in range(8): print(list[i])