N,X=map(int,input().split()) R=[0 for _ in range(X+1)] for _ in range(N): A,B=map(int,input().split()) for i in range(B): if 1<=A-i<=X: R[A-i]=max(R[A-i],B-i) if 1<=A+i<=X: R[A+i]=max(R[A+i],B-i) print(*R[1:])