def Main(): from collections import defaultdict d=defaultdict(int) ans=[0 for _ in range(8)] for i in range(int(input())): s,c=input().split() d[s]=int(c) for x in d.keys(): ans[d[x]]+=1 for x in ans: print(x) Main()