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