n=int(input()) d=dict() for _ in range(n): k,v=input().split() d[k]=v C=[0]*8 for k,v in d.items(): C[int(v)]+=1 for e in C: print(e)