n = int(input()) d = {} l = [0] * 8 for i in range(n): k,v = input().split() d[k] = v for i in d.keys(): l[int(d[i])] += 1 for i in l: print(i)