The first line contains one integer $T$, indicating the number of test cases.
The following lines describe all the test cases. For each test case:
The first line contains two integers $n$ and $m$.
Each of the following $(n - 1)$ lines contains two integers $u$ and $v$, indicating an edge between vertex $u$ and vertex $v$.
Let $\mathrm{lastans}$ be the last answer before each day. At the beginning day of each test case, $\mathrm{lastans}$ is initialized as $0$.
Each of the following $m$ lines contains three integers $u'$, $v'$ and $w'$, satifying $u = ((u' + \mathrm{lastans}) \bmod n) + 1$, $v = ((v' + \mathrm{lastans}) \bmod n) + 1$, $w = (w' + \mathrm{lastans}) \bmod n$, which means one day Noah will pick vertices $u$ and $v$ to get influence and the influence will be disappeared if it has passed through more than $w$ edges.
$1 \leq T \leq 100$, $1 \leq n, m \leq 10^5$, $1 \leq u, v, u', v' \leq n$, $0 \leq w' < n$.
It is guaranteed that no more than $10$ test cases do not satisfy $n, m \leq 10^3$ and the size of the standard input file does not exceed $32$ MiB.