N = int(input()) SC = [input().split() for _ in range(N)] d = dict() for s, c in SC: d[s] = int(c) coder = [0 for _ in range(8)] for k in d: coder[d[k]] += 1 for c in coder: print(c)