import sys

ary=[]
ans=[]
def gcd(a,b):
    x=sorted([a,b])
    while x[1]%x[0]!=0:
        dif=x[1]%x[0]
        x[1]=x[0]
        x[0]=dif
    return x[0]
for i in sys.stdin:
    ary.append(list(map(int,i.split())))
    ans.append([gcd(*ary[-1]),int(ary[-1][0]*ary[-1][1]/gcd(*ary[-1]))])
for i in range(len(ans)):
    print('{0:d} {1:d}'.format(*ans[i])) import sys sys ary=[] ary [] ans=[] ans [] def gcd(a,b):
    x=sorted([a,b])
    while x[1]%x[0]!=0:
        dif=x[1]%x[0]
        x[1]=x[0]
        x[0]=dif
    return x[0] gcd x=sorted([a,b]) x sorted([a,b]) sorted [a,b] a b while x[1]%x[0]!=0:
        dif=x[1]%x[0]
        x[1]=x[0]
        x[0]=dif
     x[1]%x[0]!=0 x[1]%x[0] x[1] x 1 x[0] x 0 0 dif=x[1]%x[0] dif x[1]%x[0] x[1] x 1 x[0] x 0 x[1]=x[0] x[1] x 1 x[0] x 0 x[0]=dif x[0] x 0 dif return x[0] x[0] x 0 a a b b for i in sys.stdin:
    ary.append(list(map(int,i.split())))
    ans.append([gcd(*ary[-1]),int(ary[-1][0]*ary[-1][1]/gcd(*ary[-1]))]) i sys.stdin sys stdin ary.append(list(map(int,i.split()))) ary.append ary append list(map(int,i.split())) list map(int,i.split()) map int i.split() i.split i split ans.append([gcd(*ary[-1]),int(ary[-1][0]*ary[-1][1]/gcd(*ary[-1]))]) ans.append ans append [gcd(*ary[-1]),int(ary[-1][0]*ary[-1][1]/gcd(*ary[-1]))] gcd(*ary[-1]) gcd *ary[-1] ary[-1] ary -1 int(ary[-1][0]*ary[-1][1]/gcd(*ary[-1])) int ary[-1][0]*ary[-1][1]/gcd(*ary[-1]) ary[-1][0]*ary[-1][1] ary[-1][0] [-1] ary -1 0 ary[-1][1] [-1] ary -1 1 gcd(*ary[-1]) gcd *ary[-1] ary[-1] ary -1 for i in range(len(ans)):
    print('{0:d} {1:d}'.format(*ans[i])) i range(len(ans)) range len(ans) len ans print('{0:d} {1:d}'.format(*ans[i])) print '{0:d} {1:d}'.format(*ans[i]) '{0:d} {1:d}'.format '{0:d} {1:d}' format *ans[i] ans[i] ans i def gcd(a,b):
    x=sorted([a,b])
    while x[1]%x[0]!=0:
        dif=x[1]%x[0]
        x[1]=x[0]
        x[0]=dif
    return x[0] def gcd(a,b):
    x=sorted([a,b])
    while x[1]%x[0]!=0:
        dif=x[1]%x[0]
        x[1]=x[0]
        x[0]=dif
    return x[0] gcd ans=[] [] ans ary=[] [] ary
import sys

ary=[]
ans=[]
def gcd(a,b):
    x=sorted([a,b])
    while x[1]%x[0]!=0:
        dif=x[1]%x[0]
        x[1]=x[0]
        x[0]=dif
    return x[0]
for i in sys.stdin:
    ary.append(list(map(int,i.split())))
    ans.append([gcd(*ary[-1]),int(ary[-1][0]*ary[-1][1]/gcd(*ary[-1]))])
for i in range(len(ans)):
    print('{0:d} {1:d}'.format(*ans[i]))