import fileinput


def GCD(x, y):
    if y != 0:
        return GCD(y, x % y)
    else:
        return x

for line in fileinput.input():
    x, y = [int(s) for s in line.split()]
    #print("{} {}".format(GCD(x, y), int(x * y/GCD(x, y))))#別にformatでなくてもいい
    print(GCD(x, y),int(x * y/GCD(x, y))) import fileinput fileinput def GCD(x, y):
    if y != 0:
        return GCD(y, x % y)
    else:
        return x GCD if y != 0:
        return GCD(y, x % y)
    else:
        return x y != 0 y 0 return GCD(y, x % y) GCD(y, x % y) GCD y x % y x y return x x x x y y for line in fileinput.input():
    x, y = [int(s) for s in line.split()]
    #print("{} {}".format(GCD(x, y), int(x * y/GCD(x, y))))#別にformatでなくてもいい
    print(GCD(x, y),int(x * y/GCD(x, y))) line fileinput.input() fileinput.input fileinput input int(s) for s in line.split() for s in line.split() s line.split() line.split line split for s in line.split() int(s) int s x, y = [int(s) for s in line.split()] x [int(s) for s in line.split()] y print(GCD(x, y),int(x * y/GCD(x, y))) print GCD(x, y) GCD x y int(x * y/GCD(x, y)) int x * y/GCD(x, y) x * y x y GCD(x, y) GCD x y x, y = [int(s) for s in line.split()] [int(s) for s in line.split()] x def GCD(x, y):
    if y != 0:
        return GCD(y, x % y)
    else:
        return x def GCD(x, y):
    if y != 0:
        return GCD(y, x % y)
    else:
        return x GCD y = [int(s) for s in line.split()] [int(s) for s in line.split()] y
import fileinput


def GCD(x, y):
    if y != 0:
        return GCD(y, x % y)
    else:
        return x

for line in fileinput.input():
    x, y = [int(s) for s in line.split()]
    #print("{} {}".format(GCD(x, y), int(x * y/GCD(x, y))))#別にformatでなくてもいい
    print(GCD(x, y),int(x * y/GCD(x, y)))
