def gcd(a,b):
    if a > b:
        x = a
        y = b
    else:
        x = b
        y = a
    while y > 0:
        r = x % y
        x = y
        y = r
    return x

def lcm(a,b,c):
    return int(a*b/c)

while 1:
    try:
        a,b = [int(x) for x in input().split()]
        res_gcd = gcd(a,b)
        res_lcm = lcm(a,b,res_gcd)
        print('{} {}'.format(res_gcd,res_lcm))
    except:
        break def gcd(a,b):
    if a > b:
        x = a
        y = b
    else:
        x = b
        y = a
    while y > 0:
        r = x % y
        x = y
        y = r
    return x gcd if a > b:
        x = a
        y = b
    else:
        x = b
        y = a
     a > b a b x = a x a y = b y b x = b x b y = a y a while y > 0:
        r = x % y
        x = y
        y = r
     y > 0 y 0 r = x % y r x % y x y x = y x y y = r y r return x x a a b b def lcm(a,b,c):
    return int(a*b/c) lcm return int(a*b/c) int(a*b/c) int a*b/c a*b a b c a a b b c c while 1:
    try:
        a,b = [int(x) for x in input().split()]
        res_gcd = gcd(a,b)
        res_lcm = lcm(a,b,res_gcd)
        print('{} {}'.format(res_gcd,res_lcm))
    except:
        break 1 try:
        a,b = [int(x) for x in input().split()]
        res_gcd = gcd(a,b)
        res_lcm = lcm(a,b,res_gcd)
        print('{} {}'.format(res_gcd,res_lcm))
    except:
        break except:
        break break int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x a,b = [int(x) for x in input().split()] a [int(x) for x in input().split()] b res_gcd = gcd(a,b) res_gcd gcd(a,b) gcd a b res_lcm = lcm(a,b,res_gcd) res_lcm lcm(a,b,res_gcd) lcm a b res_gcd print('{} {}'.format(res_gcd,res_lcm)) print '{} {}'.format(res_gcd,res_lcm) '{} {}'.format '{} {}' format res_gcd res_lcm b = [int(x) for x in input().split()] [int(x) for x in input().split()] b def gcd(a,b):
    if a > b:
        x = a
        y = b
    else:
        x = b
        y = a
    while y > 0:
        r = x % y
        x = y
        y = r
    return x def gcd(a,b):
    if a > b:
        x = a
        y = b
    else:
        x = b
        y = a
    while y > 0:
        r = x % y
        x = y
        y = r
    return x gcd res_gcd = gcd(a,b) gcd(a,b) res_gcd def lcm(a,b,c):
    return int(a*b/c) def lcm(a,b,c):
    return int(a*b/c) lcm a,b = [int(x) for x in input().split()] [int(x) for x in input().split()] a res_lcm = lcm(a,b,res_gcd) lcm(a,b,res_gcd) res_lcm
def gcd(a,b):
    if a > b:
        x = a
        y = b
    else:
        x = b
        y = a
    while y > 0:
        r = x % y
        x = y
        y = r
    return x

def lcm(a,b,c):
    return int(a*b/c)

while 1:
    try:
        a,b = [int(x) for x in input().split()]
        res_gcd = gcd(a,b)
        res_lcm = lcm(a,b,res_gcd)
        print('{} {}'.format(res_gcd,res_lcm))
    except:
        break