N,X = map(int, input().split()) A,B = list(),list() for _ in range(N): a,b = map(int, input().split()) A.append(a);B.append(b) ans = [0] * (10**6+1) for i in range(N): a,b = A[i],B[i] for j in range(0,b): if a-j < 1: pass else: ans[a-j] = max(b-abs(j),ans[a-j]) if a+j > 10**6: pass else: ans[a+j] = max(b-abs(j),ans[a+j]) print(*ans[1:X+1])