N = int(input()) coder = [0 for _ in range(8)] ans = {} for _ in range(N): S, C = input().split() C = int(C) ans[S] = C for i in ans.values: coder[i] = coder[i] + 1 for i in coder: print(i)