from collections import Counter def main(): colors = {} for _ in range(int(input())): S, C = input().split() colors[S] = int(C) color_counter = Counter(colors.values()) for color_idx in range(8): print(color_counter[color_idx]) if __name__ == "__main__": main()