num_of_person = int(input()) person_list = [] coder_list = [] for i in range(num_of_person): person, code = input().split() person_list.append(person) coder_list.append(int(code)) for i in range(8): print(coder_list.count(i))