The first line contains one integer , the number of vertices in the tree.
Each of the next lines describes an edge of the tree. Edge is denoted by three integers , the labels of vertices it connects and its weight.
Then one line contains one integer , the number of queries.
Each of the following lines contains two integers describing a query.
It is guaranteed that the given edges form a tree.