import sys
for e in sys.stdin:
 g,d=a,b=list(map(int,e.split()))
 while d:g,d=d,g%d
 print(g,a*b//g) import sys sys for e in sys.stdin:
 g,d=a,b=list(map(int,e.split()))
 while d:g,d=d,g%d
 print(g,a*b//g) e sys.stdin sys stdin g,d=a,b=list(map(int,e.split())) g list(map(int,e.split())) list map(int,e.split()) map int e.split() e.split e split d =a,b=list(map(int,e.split())) a list(map(int,e.split())) b while d:g,d=d,g%d
  d print(g,a*b//g) print g a*b//g a*b a b g g,d=a,b=list(map(int,e.split())) list(map(int,e.split())) g b=list(map(int,e.split())) list(map(int,e.split())) b d=a,b=list(map(int,e.split())) list(map(int,e.split())) d a,b=list(map(int,e.split())) list(map(int,e.split())) a
import sys
for e in sys.stdin:
 g,d=a,b=list(map(int,e.split()))
 while d:g,d=d,g%d
 print(g,a*b//g)
