Thomas Edison stumbled upon an alien electrical device that appears to break known laws of physics! The device consists of n batteries connected by m unidirectional wires, which we will represent as vertices and edges that form a graph. The i-th wire is directed from battery v_i to battery u_i, v_i=u_i. Let (v_i→u_i) denote such a wire.
To make this device work, Thomas must assign a current strength to each wire such that this assignment results in a successful configuration. For a configuration to be successful, two conditions must be met:
Help him with this task.
The first line contains two integers n and m – the number of batteries and the number of wires in the device, respectively. Next, m lines contain two integers each v_i and u_i, which mean that the i-th wire goes from battery v_i to u_i.
Print m lines containing one number each: the i-th number should be the current strength of i-th wire (in AAMP). Each number should be non-zero and in the range of \[−1000,1000]. If multiple answers exist, you may print any one of them.
Note that there can be multiple wires from battery x to y. Also note that wire (x→y) with strength 3 AAMP is not the same as (y→x) with strength −3. As mentioned before, wires are unidirectional and can have a negative current strength - that’s one of the mysteries of this device ...