import fractions

while True:

	try:

		x,y = list(map(int,input().split()))

		print('%d %d' % (fractions.gcd(x,y),x/fractions.gcd(x,y)*y))

	except EOFError:

		break
def gcd(x, y):

    if y == 0:

        return x

    else:

        return gcd(y, x%y)





def lcm(x,y):

    return x/gcd(x, y)*y





while True:

    try:

        x, y = list(map(int, input().split()))

    except EOFError:

        break



    print("%d %d" % (gcd(x, y), lcm(x, y)))
import fractions

while True:
    try:
        x, y = list(map(int, input().split()))
        print("%d %d" % (fractions.gcd(x, y), x / fractions.gcd(x, y) * y))
    except EOFError:
        break

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


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


while True:
    try:
        x, y = list(map(int, input().split()))
    except EOFError:
        break
    print("%d %d" % (gcd(x, y), lcm(x, y)))

-import fractions +def gcd(x, y): +    if y == 0: +        return x +    else: +        return gcd(y, x % y) + + +def lcm(x, y): +    return x / gcd(x, y) * y + -        print("%d %d" % (fractions.gcd(x, y), x / fractions.gcd(x, y) * y)) +    print("%d %d" % (gcd(x, y), lcm(x, y)))