import sys

for line in sys.stdin:
    a, b = sorted(map(int, line.split(' ')))
    gcd = 1
    d = 2
    while a >= d:
        amod, bmod = a % d, b % d
        if amod == 0 and bmod == 0:
            gcd *= d
            a, b = a/d, b/d
            d = 2
            continue
        else:
            d += 1
    lcm = gcd * a * b
    print gcd, lcm import sys sys for line in sys.stdin:
    a, b = sorted(map(int, line.split(' ')))
    gcd = 1
    d = 2
    while a >= d:
        amod, bmod = a % d, b % d
        if amod == 0 and bmod == 0:
            gcd *= d
            a, b = a/d, b/d
            d = 2
            continue
        else:
            d += 1
    lcm = gcd * a * b
    print gcd, lcm line sys.stdin sys stdin a, b = sorted(map(int, line.split(' '))) a sorted(map(int, line.split(' '))) sorted map(int, line.split(' ')) map int line.split(' ') line.split line split ' ' b gcd = 1 gcd 1 d = 2 d 2 while a >= d:
        amod, bmod = a % d, b % d
        if amod == 0 and bmod == 0:
            gcd *= d
            a, b = a/d, b/d
            d = 2
            continue
        else:
            d += 1
     a >= d a d amod, bmod = a % d, b % d amod a % d a d bmod b % d b d if amod == 0 and bmod == 0:
            gcd *= d
            a, b = a/d, b/d
            d = 2
            continue
        else:
            d += 1
     amod == 0 and bmod == 0 amod == 0 amod 0 bmod == 0 bmod 0 gcd *= d gcd d a, b = a/d, b/d a a/d a d b b/d b d d = 2 d 2 continue d += 1 d 1 lcm = gcd * a * b lcm gcd * a * b gcd * a gcd a b print gcd lcm d += 1 1 d lcm = gcd * a * b gcd * a * b lcm a, b = sorted(map(int, line.split(' '))) sorted(map(int, line.split(' '))) a gcd = 1 1 gcd b = sorted(map(int, line.split(' '))) sorted(map(int, line.split(' '))) b a, b = a/d, b/d a/d a b = a/d, b/d b/d b d = 2 2 d d = 2 2 d amod, bmod = a % d, b % d a % d amod bmod = a % d, b % d b % d bmod gcd *= d d gcd
import sys

for line in sys.stdin:
    a, b = sorted(map(int, line.split(' ')))
    gcd = 1
    d = 2
    while a >= d:
        amod, bmod = a % d, b % d
        if amod == 0 and bmod == 0:
            gcd *= d
            a, b = a/d, b/d
            d = 2
            continue
        else:
            d += 1
    lcm = gcd * a * b
    print gcd, lcm