coders = {} for _ in range(int(input())): s,c=input().split() coders[s]=int(c) for i in range(8): print(sum(z == i for z in coders.values()))