N, X = map(int, input().split()) L = [0 for i in range(X)] for _ in range(N): A, B = map(int, input().split()) A -= 1 for i in range(X): L[i] = max(L[i], B - abs(i - A)) print(" ".join(map(str, L)))