We have a tree $\langle V,E\rangle$ consists of $n$ vertices with weight $a_i (i \in V)$ on the vertices and weight $b_e (e=\langle u,v\rangle \in E)$ on the bidirectional edges. $a_i$ is a non-negative integer and $b_e$ is an integer.
You can perform no more than $4n$ following operations:
For the shortest path from $x$ to $y$ traveling $k+1$ vertices $(v_0,v_1,v_2,...,v_k)$ where $v_0 = x ,v_k = y$, let $e_i=\langle v_{i},v_{i+1}\rangle (0 \leq i < k)$. In one operation, you can choose $2$ vertices $x,y$ and a non-negative integer $w$, to make:
$$a_x \leftarrow a_x \bigoplus w;\quad a_y \leftarrow a_y \bigoplus w;\quad b_{e_i}\leftarrow b_{e_i} + (-1) ^ i w \, (0 \leq i < k)$$
Where $\bigoplus$ denotes the bitwise XOR operation. We can notice that if $x=y$, nothing will change.
You need to decide whether it is possible to make all $a_i,b_{e}$ equal to $0$. If it is possible, output a solution using no more than $4n$ operations described above.