N, X = map(int, input().split()) A = [] B = [] for _ in range(N): a, b = map(int, input().split()) A.append(a-1) B.append(b) brights = [0]*(X) for i in range(N): brights[A[i]] = max(brights[A[i]], B[i]) cur = 0 for i in range(X): cur = max(cur, brights[i]) brights[i] = cur if 0 < cur: cur -= 1 for i in range(X-1, -1, -1): cur = max(cur, brights[i]) brights[i] = cur if 0 < cur: cur -= 1 print(*brights)