# -*- coding: utf-8 -*-

import sys

for line in sys.stdin:
    a, b = map(int, line.split())
    t1, t2 = a, b
    while True:
        if a%b:
            a, b = b, a%b
        else:
            break
    gcd = b
    lcm = t1/gcd*t2
    print "%d %d" %(gcd, lcm) import sys sys for line in sys.stdin:
    a, b = map(int, line.split())
    t1, t2 = a, b
    while True:
        if a%b:
            a, b = b, a%b
        else:
            break
    gcd = b
    lcm = t1/gcd*t2
    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 t1, t2 = a, b t1 a t2 b while True:
        if a%b:
            a, b = b, a%b
        else:
            break
     True if a%b:
            a, b = b, a%b
        else:
            break
     a%b a b a, b = b, a%b a b b a%b a b break gcd = b gcd b lcm = t1/gcd*t2 lcm t1/gcd*t2 t1/gcd t1 gcd t2 print "%d %d" %(gcd, lcm) "%d %d" (gcd, lcm) gcd lcm a, b = map(int, line.split()) map(int, line.split()) a b = map(int, line.split()) map(int, line.split()) b t2 = a, b b t2 a, b = b, a%b b a lcm = t1/gcd*t2 t1/gcd*t2 lcm t1, t2 = a, b a t1 b = b, a%b a%b b gcd = b b gcd
# -*- coding: utf-8 -*-

import sys

for line in sys.stdin:
    a, b = map(int, line.split())
    t1, t2 = a, b
    while True:
        if a%b:
            a, b = b, a%b
        else:
            break
    gcd = b
    lcm = t1/gcd*t2
    print "%d %d" %(gcd, lcm)