N = int(input()) d = [] for _ in range(N): S,c = input().split() c = int(c) d[S] = c from collections import defaultdict e = defaultdict(int) for c in d.values(): e[c] += 1 for i in range(8): print(e[i])