n = int(input()) d = {} for _ in range(n): s, c = input().split() d[s] = int(c) cnt = [0] * 8 for x in d.values(): cnt[x] += 1 print(*cnt, sep='\n')