N = int(input()) lst = {} for _ in range(N): si, ci = input().split() lst[si] = int(ci) res = [0] * 8 for s in lst: res[lst[s]] += 1 for i in range(8): print(res[i])