def gcd(x, y):
    if x > y:
        x, y = y, x
    while x > 0:
        x, y = y%x, x
    return y

def lcm(x, y):
    z = gcd(x, y)
    return x*y//z

if __name__ == "__main__":
    while True:
        try:
            a, b = map(int, input().split())
            g = gcd(a, b)
            l = lcm(a, b)
            print("{} {}".format(g, l))
        except:
            break
 def gcd(x, y):
    if x > y:
        x, y = y, x
    while x > 0:
        x, y = y%x, x
    return y gcd if x > y:
        x, y = y, x
     x > y x y x, y = y, x x y y x while x > 0:
        x, y = y%x, x
     x > 0 x 0 x, y = y%x, x x y%x y x y x return y y x x y y def lcm(x, y):
    z = gcd(x, y)
    return x*y//z lcm z = gcd(x, y) z gcd(x, y) gcd x y return x*y//z x*y//z x*y x y z x x y y if __name__ == "__main__":
    while True:
        try:
            a, b = map(int, input().split())
            g = gcd(a, b)
            l = lcm(a, b)
            print("{} {}".format(g, l))
        except:
            break __name__ == "__main__" __name__ "__main__" while True:
        try:
            a, b = map(int, input().split())
            g = gcd(a, b)
            l = lcm(a, b)
            print("{} {}".format(g, l))
        except:
            break True try:
            a, b = map(int, input().split())
            g = gcd(a, b)
            l = lcm(a, b)
            print("{} {}".format(g, l))
        except:
            break except:
            break break a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b g = gcd(a, b) g gcd(a, b) gcd a b l = lcm(a, b) l lcm(a, b) lcm a b print("{} {}".format(g, l)) print "{} {}".format(g, l) "{} {}".format "{} {}" format g l g = gcd(a, b) gcd(a, b) g a, b = map(int, input().split()) map(int, input().split()) a b = map(int, input().split()) map(int, input().split()) b def gcd(x, y):
    if x > y:
        x, y = y, x
    while x > 0:
        x, y = y%x, x
    return y def gcd(x, y):
    if x > y:
        x, y = y, x
    while x > 0:
        x, y = y%x, x
    return y gcd def lcm(x, y):
    z = gcd(x, y)
    return x*y//z def lcm(x, y):
    z = gcd(x, y)
    return x*y//z lcm l = lcm(a, b) lcm(a, b) l
def gcd(x, y):
    if x > y:
        x, y = y, x
    while x > 0:
        x, y = y%x, x
    return y

def lcm(x, y):
    z = gcd(x, y)
    return x*y//z

if __name__ == "__main__":
    while True:
        try:
            a, b = map(int, input().split())
            g = gcd(a, b)
            l = lcm(a, b)
            print("{} {}".format(g, l))
        except:
            break

