import sys


def euc(n,m):
    if max(n,m)%min(n,m) == 0:
        return min(n,m)
    else:
        return euc(min(n,m), max(n,m)%min(n,m))


for line in sys.stdin:
    a,b = [int(i) for i in line.split()]
    print(euc(a,b),int(a*b/euc(a,b)))
 import sys sys def euc(n,m):
    if max(n,m)%min(n,m) == 0:
        return min(n,m)
    else:
        return euc(min(n,m), max(n,m)%min(n,m)) euc if max(n,m)%min(n,m) == 0:
        return min(n,m)
    else:
        return euc(min(n,m), max(n,m)%min(n,m)) max(n,m)%min(n,m) == 0 max(n,m)%min(n,m) max(n,m) max n m min(n,m) min n m 0 return min(n,m) min(n,m) min n m return euc(min(n,m), max(n,m)%min(n,m)) euc(min(n,m), max(n,m)%min(n,m)) euc min(n,m) min n m max(n,m)%min(n,m) max(n,m) max n m min(n,m) min n m n n m m for line in sys.stdin:
    a,b = [int(i) for i in line.split()]
    print(euc(a,b),int(a*b/euc(a,b))) line sys.stdin sys stdin int(i) for i in line.split() for i in line.split() i line.split() line.split line split for i in line.split() int(i) int i a,b = [int(i) for i in line.split()] a [int(i) for i in line.split()] b print(euc(a,b),int(a*b/euc(a,b))) print euc(a,b) euc a b int(a*b/euc(a,b)) int a*b/euc(a,b) a*b a b euc(a,b) euc a b b = [int(i) for i in line.split()] [int(i) for i in line.split()] b a,b = [int(i) for i in line.split()] [int(i) for i in line.split()] a def euc(n,m):
    if max(n,m)%min(n,m) == 0:
        return min(n,m)
    else:
        return euc(min(n,m), max(n,m)%min(n,m)) def euc(n,m):
    if max(n,m)%min(n,m) == 0:
        return min(n,m)
    else:
        return euc(min(n,m), max(n,m)%min(n,m)) euc
import sys


def euc(n,m):
    if max(n,m)%min(n,m) == 0:
        return min(n,m)
    else:
        return euc(min(n,m), max(n,m)%min(n,m))


for line in sys.stdin:
    a,b = [int(i) for i in line.split()]
    print(euc(a,b),int(a*b/euc(a,b)))

