N,X=map(int,input().split()) L=[0]*X for i in range(N): A,B=map(int,input().split()) if L[A-1]0 and L[l]>0: L[l-1]=max(L[l-1],L[l]-1) l-=1 while r0: L[r+1]=max(L[r+1],L[r]-1) r+=1 print(*L)