N, X = map(int, input().split()) res = [0] * X for _ in range(N): index, val = map(int, input().split()) res[index-1] = val cur = val-1 for j in range(index, X): if res[j] < cur: res[j] = cur cur -= 1 else: break cur = val-1 for j in reversed(range(0, index-1)): if res[j] < cur: res[j] = cur cur -= 1 else: break print(*res)