num_of_person = int(input()) coders = [] for i in range(num_of_person): person, level = input().split() coders[person] = int(level) for i in range(8): print(sum(z == i for z in coders.values()))