n = int(input()) l = [0]*8 for i in range(n): s,t = input().split() t = int(t) l[t] += 1 for i in range(8): print(l[i])