n, x = map(int, input().split()) ans = [0] * x d = [0] * x for _ in range(n): a, b = map(int, input().split()) a -= 1 d[a] = max(d[a], b) ans = [0] * x for _ in range(2): now = 0 for i in range(x): now = max(d[i], now) ans[i] = max(ans[i], now) now -= 1 ans.reverse() d.reverse() print(*ans)