N = int(input()) D = dict() for _ in range(N): S,C = map(str,input().split()) C = int(C) D[S] = C count = [0]*8 for x in D: count[D[x]] += 1 for i in range(8): print(count[i])