**Problem Description**

**Input**

An integer T in the first line, indicates the number of test data group(T<=10).

Then follows T groups of test data.

In each group: an integer N in first line indicates the number of cities(Nodes are numbered from 1 to N),(1<=N<=100000).

In the following N-1 lines, there are 3 integers (a,b,c) in each line indicates there is a road between node a and node b, with Fraction Value c (0<=c<=100000).

Then an integer M, indicates the number of routes (1<=M<=100000).

In the following M lines, 2 integers u and v are include in each line indicates one route. For each route please calculate the damage value from node u to node v (The initial heat value of each route is 1).

**Output**

M lines for each group of data. One result in each line.

**Sample Input**

2 4 1 2 1 2 3 2 3 4 3 2 1 4 3 4 5 1 5 1 2 4 2 2 3 3 1 2 4 2 1 3 2 5

**Sample Output**

14 3 10 6

**Source**

2014市赛