Types: n: int, node_info: List[Tuple[int, List[int]]], q: int, queries: List[Tuple[int, Union[Tuple[int, int], int]]]
Ranges: 2 ≤ n ≤ 100000, 0 ≤ node_id < n, 2 ≤ q ≤ 200000, 1 ≤ u,v ≤ n-1, 1 ≤ w ≤ 10000
Addtl Info: The tree is rooted at node 0. Node IDs of children are given in strictly increasing order.