The first line has the number of vertices N (2≤N≤100,000) and the number of queries Q (1≤Q≤100,000).
Each of the next N−1 lines has an edge as u, v, w: vertices u and v are joined by an edge of length w. (0≤u,v≤N−1, u=v, 0≤w≤1,000,003)
Each of the next Q lines has one query. The first integer is the kind of the query, 1 or 2, and the second integer is x (0≤x≤N−1).