N=int(input()) dict={} for i in range(N): S,C=input().split(' ') dict[S]=int(C) for i in range(8): print(sum(v==i for v in dict.values()))