n = int(input()) uDic = {} for i in range(n): sList = input().split() uDic[sList[0]] = int(sList[1]) cList = [0,0,0,0,0,0,0,0] for i in uDic.keys(): cList[uDic[i]] = cList[uDic[i]] + 1 #print(cList) for i in cList: print(i)