N,X = map(int,input().split()) ans = [0]*X for _ in range(N): a,b = map(int,input().split()) for u in range(X): ans[u] = max(ans[u],b-abs(u+1-a)) print(*ans)