Maximum forest cover digraph
Set-oriented weighted graph. Required to cover its set of outgoing total maximum value of the trees that are disjoint from the top.
Input
The input file consists of one or more sets of input data. Each set begins with a line containing two integers n and m (1 ≤ n ≤ 200, 0 ≤ m ≤ 10000). n - number of vertices and m - the number of edges. Next is the m lines, each of which contains three numbers x_i, y_i, c_i - start vertex, end vertex and the weight of the arc. Digraph has no loops, but may contain multiple arcs.
The total number of edges over all sets of input data of one test does not exceed 10000.
Output
For each set of input output three lines. The first of these output weights of optimal covering the trees, the second - the number of arcs in the coating, the third - numbers selected to cover edges. Bring a blank line after each block of output data.