You are given a tree whose vertices are numbered from to . Initially, every vertex has value .
Process queries of the following form.
Both endpoints are included. Reversing a query can change the amounts added. After processing all queries, find the value of each vertex modulo .
The input is given in the following format. The first line contains the number of vertices and the number of queries . Each of the next lines describes an edge , and each of the following lines gives a query . There are no edge lines when and no query lines when .
Print the final values of vertices , each reduced modulo , on one line separated by spaces.
The query paths are , then , then . The final values in vertex order are .
| 3 | 55 | No additional constraints. |
The first query adds to the vertices, and the second adds . Every final value is .