import sys
for line in sys.stdin:
    a, b = map(int, line.split())
    A, B = min(a, b), max(a, b)

    while True:
        mod = B % A
        if mod == 0:
            gcd = A
            break
        else:
            A, B = mod, A
    lcm = gcd * (a / gcd) * (b / gcd)

    print '%d %d' % (gcd, lcm) import sys sys for line in sys.stdin:
    a, b = map(int, line.split())
    A, B = min(a, b), max(a, b)

    while True:
        mod = B % A
        if mod == 0:
            gcd = A
            break
        else:
            A, B = mod, A
    lcm = gcd * (a / gcd) * (b / gcd)

    print '%d %d' % (gcd, lcm) line sys.stdin sys stdin a, b = map(int, line.split()) a map(int, line.split()) map int line.split() line.split line split b A, B = min(a, b), max(a, b) A min(a, b) min a b B max(a, b) max a b while True:
        mod = B % A
        if mod == 0:
            gcd = A
            break
        else:
            A, B = mod, A
     True mod = B % A mod B % A B A if mod == 0:
            gcd = A
            break
        else:
            A, B = mod, A
     mod == 0 mod 0 gcd = A gcd A break A, B = mod, A A mod B A lcm = gcd * (a / gcd) * (b / gcd) lcm gcd * (a / gcd) * (b / gcd) gcd * (a / gcd) gcd a / gcd a gcd b / gcd b gcd print '%d %d' % (gcd, lcm) '%d %d' (gcd, lcm) gcd lcm b = map(int, line.split()) map(int, line.split()) b A, B = min(a, b), max(a, b) min(a, b) A A, B = mod, A mod A mod = B % A B % A mod lcm = gcd * (a / gcd) * (b / gcd) gcd * (a / gcd) * (b / gcd) lcm a, b = map(int, line.split()) map(int, line.split()) a B = mod, A A B B = min(a, b), max(a, b) max(a, b) B gcd = A A gcd
import sys
for line in sys.stdin:
    a, b = map(int, line.split())
    A, B = min(a, b), max(a, b)

    while True:
        mod = B % A
        if mod == 0:
            gcd = A
            break
        else:
            A, B = mod, A
    lcm = gcd * (a / gcd) * (b / gcd)

    print '%d %d' % (gcd, lcm)