There are multiple test cases.
Each case starts with a line containing two positive integers $N, Q(2 \leq N \leq 10^5, 1 \leq Q \leq 10^5)$.
The second line contains $N$ integers $a_1, a_2, ..., a_N(1 \leq a_i \leq 10^9)$ denoting the values of vertices of the first tree.
Then follow $N - 1$ lines. Each line contains three integers $u, v, w(1 \leq u, v \leq n, 1 \leq w \leq 10^9)$ describing the first tree. Namely, $u, v, w$ means that there is an edge weighted $w$ between vertice $u$ and vertice $v$.
Then follow $N - 1$ lines. Each line contains three integers $u, v, w(1 \leq u, v \leq n, 1 \leq w \leq 10^9)$ describing the second tree.
Then follow $Q$ lines. Each line contains two integers $u, w(1 \leq u \leq n, 1 \leq w \leq 10^9)$, denoting the value of vertice $u$ of the first tree will be modified to $w$.
It is guaranteed that the sum of $N$s and the sum of $Q$s in all test cases are both no larger than $2 \times 10^5$.
There is only one test case which contains $N$ and $Q$ that are both larger than $2 \times 10^4$.
It is guaranteed that $N$ and $Q$ in every other test case are all no larger than $2 \times 10^4$.