N=int(input()) l=[tuple(input().split()) for _ in range(N)] d={} for t in l: d[t[0]]=t[1] ans_l=[0]*8 for key in d: ans_l[int(d[key])]+=1 for a in ans_l: print(a)