from sys import stdin
import math

def GCD(a,b):
    if(a%b==0):
        return b
    else:
        c = a%b
        return GCD(b,c)

def LCM(a,b):
    gcd = GCD(a,b)
    return int(a*b/gcd)

for line in stdin:
    a,b = line.split(" ")
    a = int(a)
    b = int(b)
    gcd = GCD(a,b)
    lcm = LCM(a,b)

    print(str(gcd)+" "+str(lcm))

 from sys import stdin import math math def GCD(a,b):
    if(a%b==0):
        return b
    else:
        c = a%b
        return GCD(b,c) GCD if(a%b==0):
        return b
    else:
        c = a%b
        return GCD(b,c) a%b==0 a%b a b 0 return b b c = a%b c a%b a b return GCD(b,c) GCD(b,c) GCD b c a a b b def LCM(a,b):
    gcd = GCD(a,b)
    return int(a*b/gcd) LCM gcd = GCD(a,b) gcd GCD(a,b) GCD a b return int(a*b/gcd) int(a*b/gcd) int a*b/gcd a*b a b gcd a a b b for line in stdin:
    a,b = line.split(" ")
    a = int(a)
    b = int(b)
    gcd = GCD(a,b)
    lcm = LCM(a,b)

    print(str(gcd)+" "+str(lcm)) line stdin a,b = line.split(" ") a line.split(" ") line.split line split " " b a = int(a) a int(a) int a b = int(b) b int(b) int b gcd = GCD(a,b) gcd GCD(a,b) GCD a b lcm = LCM(a,b) lcm LCM(a,b) LCM a b print(str(gcd)+" "+str(lcm)) print str(gcd)+" "+str(lcm) str(gcd)+" " str(gcd) str gcd " " str(lcm) str lcm gcd = GCD(a,b) GCD(a,b) gcd lcm = LCM(a,b) LCM(a,b) lcm b = line.split(" ") line.split(" ") b def GCD(a,b):
    if(a%b==0):
        return b
    else:
        c = a%b
        return GCD(b,c) def GCD(a,b):
    if(a%b==0):
        return b
    else:
        c = a%b
        return GCD(b,c) GCD def LCM(a,b):
    gcd = GCD(a,b)
    return int(a*b/gcd) def LCM(a,b):
    gcd = GCD(a,b)
    return int(a*b/gcd) LCM b = int(b) int(b) b a,b = line.split(" ") line.split(" ") a a = int(a) int(a) a
from sys import stdin
import math

def GCD(a,b):
    if(a%b==0):
        return b
    else:
        c = a%b
        return GCD(b,c)

def LCM(a,b):
    gcd = GCD(a,b)
    return int(a*b/gcd)

for line in stdin:
    a,b = line.split(" ")
    a = int(a)
    b = int(b)
    gcd = GCD(a,b)
    lcm = LCM(a,b)

    print(str(gcd)+" "+str(lcm))


