Two integers A and B are the inputs. Write a program to find GCD and LCM of A and B.
-----Input-----
The first line contains an integer T, total number of testcases. Then follow T lines, each line contains an integer A and B. 
-----Output-----
Display the GCD and LCM of A and B separated by space respectively. The answer for each test case must be displayed in a new line.
-----Constraints-----
- 1 ≤ T ≤ 1000
- 1 ≤ A,B ≤ 1000000
-----Example-----
Input
3 
120 140
10213 312
10 30
Output
20 840
1 3186456
10 30
# cook your dish here
import math
T = int(input())
while(T>0):
    A,B = map(int,input().split())
    hcf = math.gcd(A,B)
    lcm = (A*B)//hcf
    print(hcf,lcm)
    T = T - 1
# cook your dish here
import math
T = int(input())
while(T>0):
    A,B = map(int,input().split())
    hcf = math.gcd(A,B)
    lcm = (A*B)//hcf
    print(hcf,lcm)
    T = T - 1