~/algor $ cat problems/ekub-va-ekuk
GCD and LCM
Medium
1000 ms
64 MB
45%
You are given $q$ queries, each with two positive integers $a$ and $b$. For every query find the greatest common divisor $\gcd(a, b)$ and the least common multiple $\operatorname{lcm}(a, b)$ of $a$ and $b$.
Input
The first line contains a positive integer $q$. Each of the next $q$ lines contains two positive integers: $a$ and $b$.
Output
For every query, on its own line, two integers: $\gcd(a, b)$ and $\operatorname{lcm}(a, b)$.
Note
$1 \le q \le 10^{5}$
$1 \le a, b \le 10^{9}$
Examples
Input #1
3 12 18 7 5 10 10
Output #1
6 36 1 35 10 10
Input #2
1 1000000000 999999999
Output #2
1 999999999000000000