di = {} for i in range(int(input())): a,b = input().split() di[a] = int(b) ls = [0]*8 for i in di: ls[di[i]] += 1 for i in ls: print(i)