There are at most 20 test cases.
In each test case, the first line is an integer $n$ ($3 \leq n \leq 10^4$), denoting the number of servers. The IP address of these servers is $1 \dots n$.
Then follows $n$ lines, each line contains two integers $u$ and $v$ ($0 \leq u, v \leq n$), denoting that the server whose IP address is $u$ is connected with the server whose IP address is $v$ by netting twine initially.
After those, there is one line contains only an integer $p$ ($p \leq 50000$), denoting the number that Bittersweet uses ping.
Then follows $p$ lines, each line contains two integers $U$ and $V$ , denoting when using server $U$ to ping server $V$, it returned unsuccessful.