{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eState Z is a underwater kingdom of the Atlantic Ocean. This country is amazing. There are $n$ cities in the country and $n-1$ undirected underwater roads which connect all cities.\u003c/p\u003e\n\u003cp\u003eIn order to save energy and avoid traffic congestion, the king promulgated a series of traffic regulations:\u003c/p\u003e\n\u003col\u003e\n \u003cli\u003e\u003cp\u003eResidents have to travel on fish!\u003c/p\u003e\u003c/li\u003e\n \u003cli\u003e\u003cp\u003eResidents need to feed the fish before you start your trip!The amount of food you feed the fish should be exactly the total distance of your journey.\u003c/p\u003e\u003c/li\u003e\n \u003cli\u003e\u003cp\u003eWhat kind of food to feed depends on the total distance of your journey!Total distance is a multiple of three. You should feed the fish with Durian. Total distance modulus $3$ equaling $1$. It should be Papaya.Total distance modulus $3$ equaling $2$. It should be Avocado!!!\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eSure, fish like to eat these fruits very much.\u003c/p\u003e\n\u003cp\u003eToday is the first day of the king\u0027s decree. Because the residents here are not good at mathematics, they don\u0027t know how much fruit they need to give fish to go to other cities. So the king give an order to the energy minister Ynaonlctrm \u003cstrong\u003eFrom all cities to all cities directly\u003c/strong\u003e, which means that he will make $n*(n-1)$ trips.\u003c/p\u003e\n\u003cp\u003eFor example, A - (5 \u003cem\u003emile\u003c/em\u003e) - B - (5 \u003cem\u003emile\u003c/em\u003e) - C, he needs to run the fish, starting at A, passing B, finally arriving C (papaya 10 \u003cem\u003ekg\u003c/em\u003e), also he needs to start at C and end at A (papaya 10 \u003cem\u003ekg\u003c/em\u003e). Indirect passage is useless. \"I\u0027ve passed City B, my dear emperor.\" \"Oh! It\u0027s no use! Not directly! People in cities will never know how much the fish need to eat! The fish will surely die!!! You\u0026nbsp;also\u0026nbsp;need\u0026nbsp;to\u0026nbsp;take\u0026nbsp;several\u0026nbsp;trips\u0026nbsp;which\u0026nbsp;start\u0026nbsp;at\u0026nbsp;B\u0026nbsp;or\u0026nbsp;end\u0026nbsp;with\u0026nbsp;B!\" The Emperor said.\u003c/p\u003e\n\u003cp\u003eIt\u0027s really a tough task. Can you help him figure out how much fruit he needs to prepare for the emperor\u0027s mission?\u003c/p\u003e\n\u003ch2\u003eInput\u003c/h2\u003e\n\u003cp\u003eMultiple input!\u003c/p\u003e\n\u003cp\u003eFist line is $N$. next $N-1$ line has three integer $a$, $b$ and $c$. It represent city $a$ and city $b$ is connected by a road of $c$ nautical miles. ($1\u0026lt;n \\le 10^4$, $0 \\le a,b\u0026lt;n$, $1 \\le c\u0026lt;10^5$, $\\sum{n} \\le 10^5$)\u003c/p\u003e\n\u003ch2\u003eOutput\u003c/h2\u003e\n\u003cp\u003eFor each data, output three number, the amount of Durian, Papaya and Avocado he need. (the result could be very large, please output the result mod $10^9+7$)\u003c/p\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\n0 1 2\n0 2 3\n0 3 7\n0 4 6\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e54 60 30\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr /\u003e"}},{"title":"Sample 2","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e8\n4 7 1\n7 5 1\n4 6 1\n6 3 1\n5 2 1\n2 1 1\n7 0 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e48 54 48\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr /\u003e"}}]}