import sys
import fractions

for line in sys.stdin.readlines():
    a, b = map(int, line.split())
    gcd = fractions.gcd(a, b)
    print(gcd, a * b // gcd) import sys sys import fractions fractions for line in sys.stdin.readlines():
    a, b = map(int, line.split())
    gcd = fractions.gcd(a, b)
    print(gcd, a * b // gcd) line sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines a, b = map(int, line.split()) a map(int, line.split()) map int line.split() line.split line split b gcd = fractions.gcd(a, b) gcd fractions.gcd(a, b) fractions.gcd fractions gcd a b print(gcd, a * b // gcd) print gcd a * b // gcd a * b a b gcd a, b = map(int, line.split()) map(int, line.split()) a b = map(int, line.split()) map(int, line.split()) b gcd = fractions.gcd(a, b) fractions.gcd(a, b) gcd
import sys
import fractions

for line in sys.stdin.readlines():
    a, b = map(int, line.split())
    gcd = fractions.gcd(a, b)
    print(gcd, a * b // gcd)