import math,sys
for e in sys.stdin:
 a,b=list(map(int,e.split()));g=math.gcd(a,b)
 print(g,a*b//g) import math,sys math sys for e in sys.stdin:
 a,b=list(map(int,e.split()));g=math.gcd(a,b)
 print(g,a*b//g) e sys.stdin sys stdin a,b=list(map(int,e.split())) a list(map(int,e.split())) list map(int,e.split()) map int e.split() e.split e split b g=math.gcd(a,b) g math.gcd(a,b) math.gcd math gcd a b print(g,a*b//g) print g a*b//g a*b a b g g=math.gcd(a,b) math.gcd(a,b) g a,b=list(map(int,e.split())) list(map(int,e.split())) a b=list(map(int,e.split())) list(map(int,e.split())) b
import math,sys
for e in sys.stdin:
 a,b=list(map(int,e.split()));g=math.gcd(a,b)
 print(g,a*b//g)
