t = {} for _ in "_"*int(input()): n,c = input().split() t[n] = c a = [0]*8 for i in t.values(): a[int(i)] += 1 for i in a: print(i)