Emuskald considers himself a master of flow algorithms. Now he has completed his most ingenious program yet — it calculates the maximum flow in an undirected graph. The graph consists of *n* vertices and *m* edges. Vertices are numbered from 1 to *n*. Vertices 1 and *n* being the source and the sink respectively.

However, his max-flow algorithm seems to have a little flaw — it only finds the flow volume for each edge, but not its direction. Help him find for each edge the direction of the flow through this edges. Note, that the resulting flow should be correct maximum flow.

More formally. You are given an undirected graph. For each it's undirected edge (*a*<sub class="lower-index">*i*</sub>, *b*<sub class="lower-index">*i*</sub>) you are given the flow volume *c*<sub class="lower-index">*i*</sub>. You should direct all edges in such way that the following conditions hold:
 1.  for each vertex *v* (1 &lt; *v* &lt; *n*), sum of *c*<sub class="lower-index">*i*</sub> of incoming edges is equal to the sum of *c*<sub class="lower-index">*i*</sub> of outcoming edges; 1.  vertex with number 1 has no incoming edges; 1.  the obtained directed graph does not have cycles.
The first line of input contains two space-separated integers *n* and *m* (2 ≤ *n* ≤ 2·10<sup class="upper-index">5</sup>, *n* - 1 ≤ *m* ≤ 2·10<sup class="upper-index">5</sup>), the number of vertices and edges in the graph. The following *m* lines contain three space-separated integers *a*<sub class="lower-index">*i*</sub>, *b*<sub class="lower-index">*i*</sub> and *c*<sub class="lower-index">*i*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub>, *b*<sub class="lower-index">*i*</sub> ≤ *n*, *a*<sub class="lower-index">*i*</sub> ≠ *b*<sub class="lower-index">*i*</sub>, 1 ≤ *c*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">4</sup>), which means that there is an undirected edge from *a*<sub class="lower-index">*i*</sub> to *b*<sub class="lower-index">*i*</sub> with flow volume *c*<sub class="lower-index">*i*</sub>.

It is guaranteed that there are no two edges connecting the same vertices; the given graph is connected; a solution always exists.
print("_RANDOM_GUESS_1689434311.7641098")# 1689434311.7641299