It is rarely mentioned that Euclid's grandma was from Vrsi in Croatia. It is from there that Euclid's less known (but equally talented in his youth) cousin Edicul* comes from.
It happened one day that they were playing "invent an algorithm". Edicul writes two
positive integers on the sand. Then he does the following: while neither number on the
sand is
Formally, if
Euclid thinks for a while, and says: "Edicul, I have a better idea...", and the rest is history. Unfortunately, Edicul never became famous for his idea in number theory. This sad story inspires the following problem:
Given positive integers
* This sets up a pun in Croatian. The translation is a bit bland, sorry for that.
Input
The first line contains a single integer
Each of the following
Output
Output
The numbers in the output must not be larger than
If there are multiple solutions for some test case, output any of them.
Scoring
In all subtasks,
Subtask | Score | Constraints |
---|---|---|
No additional constraints. |
Sample Input 1
1
1 4
Sample Output 1
99 23
Explanation for Sample Output 1
The integers
Sample Input 2
2
3 2
5 5
Sample Output 2
9 39
5 5
Explanation for Sample Output 2
For the first test case,
For the second test case,
Comments