A cave full of ancient treasure has been found. The treasure is worth so much that a single successful expedition would make someone the richest person alive. One lucky archaeology company took over the whole expedition, and you are an intern there.
Here is the progress so far.
You are the engineer Gayoung hired early in the project. Using Nahee's numbers, you now have to work out which caves to explore for the largest profit. The extra cost of widening a cave and of exploring it is already computed by Dami and Lara. The cave map was finished by the field team led by Ayoung, so it is 100% accurate.
The expedition always starts at cave 1, which is the entrance. Entering any other cave without exploring cave 1 first is impossible. Because of Mari's decision there is no equipment for moving gear back to a shallower cave, so once you enter a cave you can only continue into a cave that is deeper and directly connected to it. The route is a single strand that starts at cave 1 and only goes deeper.
Exploring cave i earns vi. Moving from cave a into a directly connected cave b costs c to widen the cave and carry the gear in. The total profit is the sum of the values of the explored caves minus the sum of the costs of the tunnels you pass through. You may stop exploring at any cave, and exploring only cave 1 is allowed.
Every cave is reachable from cave 1.
The first line has the number of test cases T. (1≤T≤10)
The first line of each test case has the number of caves N and the number of directly connected cave pairs E. (1≤N≤2×104, 0≤E≤105)
The next line has N integers v1,v2,…,vN, where vi is the value of the treasure obtained by exploring cave i. (0≤vi≤104)
Each of the next E lines has three integers ae, be, ce. Cave ae is directly connected to cave be, and widening the cave and carrying the working equipment into be costs ce. (1≤ae,be≤N, 0≤ce≤104)
In the input be is always deeper than ae. Cave numbers do not follow the order of depth. The same pair of caves can appear more than once with a different cost.
The expedition always starts at cave 1, and every cave is reachable from cave 1.
Print two lines for each test case.
On the first line print the largest profit the expedition can make and the number of caves explored on that route, separated by a space.
On the second line print that route as cave numbers in visiting order, separated by spaces.
If several routes reach the largest profit, print the route whose sequence of cave numbers comes first in lexicographic order. To compare two sequences, compare the numbers from the front; if one sequence is exactly the beginning of the other, the shorter one comes first.