Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given a and b.
k = list(map(int, input().split()))

a = k[0]
b = k[1]

r = a % b
while r != 0:
    a = b
    b = r
    r = a % b
else:
    ans1 = b


a = k[0]
b = k[1]

v = a % b
index = 2
while v != 0:
    aa = a * index
    v = aa % b
    index = index + 1
else:
    ans2 = aa

print(ans1, ans2)
import sys

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
    
def lcm(a, b):
    return int(a*b / gcd(a,b))

for s in sys.stdin:
    a, b = map(int, s.split())
    
    print(gcd(a,b), lcm(a,b))