def gcd(y, x):
    if x == 0:
        return y
    return gcd(x, y%x)
try:
    while True:
        a, b = sorted(map(int, input().split()), reverse=True)
        print(gcd(a,b), a*b//gcd(a,b))
except:
    pass def gcd(y, x):
    if x == 0:
        return y
    return gcd(x, y%x) gcd if x == 0:
        return y
     x == 0 x 0 return y y return gcd(x, y%x) gcd(x, y%x) gcd x y%x y x y y x x try:
    while True:
        a, b = sorted(map(int, input().split()), reverse=True)
        print(gcd(a,b), a*b//gcd(a,b))
except:
    pass except:
    pass while True:
        a, b = sorted(map(int, input().split()), reverse=True)
        print(gcd(a,b), a*b//gcd(a,b)) True a, b = sorted(map(int, input().split()), reverse=True) a sorted(map(int, input().split()), reverse=True) sorted map(int, input().split()) map int input().split() ().split () input split reverse=True reverse True b print(gcd(a,b), a*b//gcd(a,b)) print gcd(a,b) gcd a b a*b//gcd(a,b) a*b a b gcd(a,b) gcd a b def gcd(y, x):
    if x == 0:
        return y
    return gcd(x, y%x) def gcd(y, x):
    if x == 0:
        return y
    return gcd(x, y%x) gcd b = sorted(map(int, input().split()), reverse=True) sorted(map(int, input().split()), reverse=True) b a, b = sorted(map(int, input().split()), reverse=True) sorted(map(int, input().split()), reverse=True) a
def gcd(y, x):
    if x == 0:
        return y
    return gcd(x, y%x)
try:
    while True:
        a, b = sorted(map(int, input().split()), reverse=True)
        print(gcd(a,b), a*b//gcd(a,b))
except:
    pass
