Consider the fraction, , where and are positive integers. If and , it is called a reduced proper fraction.
If we list the set of reduced proper fractions for , (where is the denominator) in ascending order of size, we get:
It can be seen that is the fraction immediately to the left of .
By listing the set of reduced proper fractions for in ascending order of size, find the numerator and denominator of the fraction immediately to the left of .
First line of input contains an integer , number of test cases.
Next lines contain separated by space.
Print the numerator and denominator separated by a space corresponding to each test case on a new line.
3 7 8
3 5 8
4 5 8
6 7 8
1 5 8