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