N = int(input()) ans = [0] * 8 for _ in range(N): s, c = input().split() ans[int(c)] += 1 print(*ans, sep="\n")