import sys

def gcm(a,b):

    return gcm(b,a%b) if b else a

for s in sys.stdin:

    a,b=list(map(int,s.split()))

    c=gcm(a,b)

    print(c,a/c*b)
import sys

def gcm(a,b):

    x=gcm(b,a%b) if b else a

    return x

for s in sys.stdin:

    a,b=list(map(int,s.split()))

    c=gcm(a,b)

    print(c,a/c*b)
import sys


def gcm(a, b):
    return gcm(b, a % b) if b else a


for s in sys.stdin:
    a, b = list(map(int, s.split()))
    c = gcm(a, b)
    print(c, a / c * b)

import sys


def gcm(a, b):
    x = gcm(b, a % b) if b else a
    return x


for s in sys.stdin:
    a, b = list(map(int, s.split()))
    c = gcm(a, b)
    print(c, a / c * b)

-    return gcm(b, a % b) if b else a +    x = gcm(b, a % b) if b else a +    return x