import sys
from fractions import gcd
for line in sys.stdin:
    a, b = map(int, line.split())
    print gcd(a, b), a*b/gcd(a,b) import sys sys from fractions import gcd for line in sys.stdin:
    a, b = map(int, line.split())
    print gcd(a, b), a*b/gcd(a,b) 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 print gcd(a, b) gcd a b a*b/gcd(a,b) a*b a b gcd(a,b) gcd a b a, b = map(int, line.split()) map(int, line.split()) a b = map(int, line.split()) map(int, line.split()) b
import sys
from fractions import gcd
for line in sys.stdin:
    a, b = map(int, line.split())
    print gcd(a, b), a*b/gcd(a,b)