import sys
import math
def gcd(x,y):
    if(x%y==0):
        return y
    else:
        return(gcd(y,x%y))
try:
    while True:
        a,b= map(int, input().split())
        max1=gcd(a,b)
        min1=(a*b)//gcd(a,b)
        print(str(max1)+' '+str(min1))
except EOFError:
    pass import sys sys import math math def gcd(x,y):
    if(x%y==0):
        return y
    else:
        return(gcd(y,x%y)) gcd if(x%y==0):
        return y
    else:
        return(gcd(y,x%y)) x%y==0 x%y x y 0 return y y return(gcd(y,x%y)) gcd(y,x%y) gcd y x%y x y x x y y try:
    while True:
        a,b= map(int, input().split())
        max1=gcd(a,b)
        min1=(a*b)//gcd(a,b)
        print(str(max1)+' '+str(min1))
except EOFError:
    pass except EOFError:
    pass while True:
        a,b= map(int, input().split())
        max1=gcd(a,b)
        min1=(a*b)//gcd(a,b)
        print(str(max1)+' '+str(min1)) True a,b= map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b max1=gcd(a,b) max1 gcd(a,b) gcd a b min1=(a*b)//gcd(a,b) min1 (a*b)//gcd(a,b) a*b a b gcd(a,b) gcd a b print(str(max1)+' '+str(min1)) print str(max1)+' '+str(min1) str(max1)+' ' str(max1) str max1 ' ' str(min1) str min1 min1=(a*b)//gcd(a,b) (a*b)//gcd(a,b) min1 max1=gcd(a,b) gcd(a,b) max1 b= map(int, input().split()) map(int, input().split()) b a,b= map(int, input().split()) map(int, input().split()) a def gcd(x,y):
    if(x%y==0):
        return y
    else:
        return(gcd(y,x%y)) def gcd(x,y):
    if(x%y==0):
        return y
    else:
        return(gcd(y,x%y)) gcd
import sys
import math
def gcd(x,y):
    if(x%y==0):
        return y
    else:
        return(gcd(y,x%y))
try:
    while True:
        a,b= map(int, input().split())
        max1=gcd(a,b)
        min1=(a*b)//gcd(a,b)
        print(str(max1)+' '+str(min1))
except EOFError:
    pass
