The first line contains N (2 ≤ N ≤ 100,000).
Each of the next N-1 lines contains the two vertex numbers u and v joined by edge i, and the cost w of that edge. The value w is a natural number no greater than 1,000,000.
The next line contains the number of queries M (1 ≤ M ≤ 100,000).
Each of the next M lines contains one query. In a query of type 2, k is a natural number no greater than the number of vertices on the path from u to v.