The first line contains two integers.
The followinglines each contain two integers
representing that there's an edge between
and
on the tree.
The following $m$ lines each contains three integersrepresenting an operation.
Outputlines. The
-th line contains an integer representing the final weight of the
-th edge in the input order.
For the first operation, the smallest connected component contains vertices.
For the second operation, the smallest connected component contains vertices.
For the third operation, the smallest connected component contains vertices.
,
,
,
,
.