from collections import Counter n = int(input()) task = [] for _ in range(n): t = tuple(input().split()) task.append(t) N = [i for i in range(0, 8)] name = set() cnt = Counter(N) for i in range(n-1, -1, -1): if not task[i][0] in name: name.add(task[i][0]) cnt[int(task[i][1])] += 1 print(*list(map(lambda x: x-1, cnt.values())), sep='\n')