n=int(input()) d={} for i in range(n): s,c=input().split() c=int(c) if s not in d: d[s]=0 d[s]=c c=[0]*8 for s in d: c[d[s]]+=1 print(*c,sep="\n")