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