def f(x, y):
    if x % y == 0:
        return y
    return f(y, x % y)
a = []
while True:
    try:
        a.append(list(map(int, input().split())))
    except EOFError:
        break
for i in a:
    g = f(i[0], i[1])
    l = (i[0] * i[1]) / g
    print(g, int(l))
 def f(x, y):
    if x % y == 0:
        return y
    return f(y, x % y) f if x % y == 0:
        return y
     x % y == 0 x % y x y 0 return y y return f(y, x % y) f(y, x % y) f y x % y x y x x y y a = [] a [] while True:
    try:
        a.append(list(map(int, input().split())))
    except EOFError:
        break True try:
        a.append(list(map(int, input().split())))
    except EOFError:
        break except EOFError:
        break break a.append(list(map(int, input().split()))) a.append a append list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split for i in a:
    g = f(i[0], i[1])
    l = (i[0] * i[1]) / g
    print(g, int(l)) i a g = f(i[0], i[1]) g f(i[0], i[1]) f i[0] i 0 i[1] i 1 l = (i[0] * i[1]) / g l (i[0] * i[1]) / g i[0] * i[1] i[0] i 0 i[1] i 1 g print(g, int(l)) print g int(l) int l g = f(i[0], i[1]) f(i[0], i[1]) g def f(x, y):
    if x % y == 0:
        return y
    return f(y, x % y) def f(x, y):
    if x % y == 0:
        return y
    return f(y, x % y) f l = (i[0] * i[1]) / g (i[0] * i[1]) / g l a = [] [] a
def f(x, y):
    if x % y == 0:
        return y
    return f(y, x % y)
a = []
while True:
    try:
        a.append(list(map(int, input().split())))
    except EOFError:
        break
for i in a:
    g = f(i[0], i[1])
    l = (i[0] * i[1]) / g
    print(g, int(l))

