Author:  A. Baranov  Time limit:  1 sec  
Input file:  Standard input  Memory limit:  256 Mb  
Output file:  Standard output 
The scientists of Flatland have discovered that the universe they live in is topologically similar to the surface of a torus.
This means that along each coordinate axis x and y, the periodicity condition is satisfied with a respective period Lx and Ly.
In other words, points at coordinates (x + u ⋅ Lx, y + v ⋅ Ly) with any integer values u and v are identical.
For the purpose of a scientific experiment, a ray is emitted from a point with coordinates (0, 0), directed by the vector D⃗ = (dx, dy).
It is required to determine the distance the ray will travel before reaching the initial point.
The result should be expressed in units equal to the length of the vector D⃗,
In other words, the task is to find the minimum coefficient λ > 0, such that by shifting the vector, one can reach the initial point.
The obtained number should be represented as an irreducible fraction: λ = αβ.
The beginning of the input data contains a natural numbe n, followed by exactly n queries,
each specified by a set of integers: Lx_{i}, Ly_{i}, dx_{i} и dy_{i}.
The output data should contain the values α_{i} и β_{i},
obtained in response to each ith query.
1 ≤ (Lx_{i}, Ly_{i}) ≤ 10^{6}, − 10^{6} ≤ (dx_{i}, dy_{i}) ≤ 10^{6},
dx_{i} + dy_{i} > 0,
1 ≤ n ≤ 10^{5}.
No.  Standard input  Standard output 

1 

