N=int(input()) D={} for i in range(N): x,y=input().split() y=int(y) if x not in D: D[x]=0 D[x]=y ans=[0]*8 for d in D: ans[D[d]]+=1 for i in ans: print(i)