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