from collections import defaultdict n = int(input()) d = defaultdict(int) for _ in range(n): s, c = input().split() d[s] = int(c) c = [0] * 8 for i in d.items(): c[i[1]] += 1 print(*c)