N, X = map(int, input().split()) AB = [list(map(int, input().split())) for _ in range(N)] C = [0]*X for A, B in AB: A -= 1 now = A strength = B while 0 <= now: C[now] = max(C[now], strength) now -= 1 strength -= 1 now = A strength = B while now < X: C[now] = max(C[now], strength) now += 1 strength -= 1 print(*C)