n = int(input()) ans = [0]*9 import collections check = collections.defaultdict(int) for i in range(n): a,b = input().split() check[a] = int(b) #print(check) for i in check: ans[check[i]] += 1 for i in range(1,9): print(ans[i])