n=int(input())
lis,num=[],[]for i inrange(n):
li=input().split()for j inrange(2):
li[j]=int(li[j])
lis.append(li)for k inrange(n):
a=[lis[k][0],lis[k][1]+1]
b=[lis[k][0],lis[k][1]-1]
c=[lis[k][0]+1,lis[k][1]]
d=[lis[k][0]-1,lis[k][1]]if a in lis and b in lis and c in lis and d in lis:
s=0
e=[lis[k][0]+1,lis[k][1]+1]
f=[lis[k][0]-1,lis[k][1]+1]
g=[lis[k][0]-1,lis[k][1]-1]
h=[lis[k][0]+1,lis[k][1]-1]if e in lis:
s+=1if f in lis:
s+=1if g in lis:
s+=1if h in lis:
s+=1
num.append(s)print('{}\n{}\n{}\n{}\n{}'.format\
(num.count(0),num.count(1),num.count(2),num.count(3),num.count(4)))