def gcd(a, b):
    while b != 0:
        y = a % b
        a = b
        b = y
    return a


d = []
m = []
while True:
    try:
        a, b = map(int, input().split())
        if a > b:
            num = gcd(a, b)
        elif a < b:
            num = gcd(b, a)
        else:
            num = a
        d.append(num)
        m.append(int(a*b/num))
    except EOFError:
        break

for i in range(len(d)):
    print(d[i], m[i]) def gcd(a, b):
    while b != 0:
        y = a % b
        a = b
        b = y
    return a gcd while b != 0:
        y = a % b
        a = b
        b = y
     b != 0 b 0 y = a % b y a % b a b a = b a b b = y b y return a a a a b b d = [] d [] m = [] m [] while True:
    try:
        a, b = map(int, input().split())
        if a > b:
            num = gcd(a, b)
        elif a < b:
            num = gcd(b, a)
        else:
            num = a
        d.append(num)
        m.append(int(a*b/num))
    except EOFError:
        break True try:
        a, b = map(int, input().split())
        if a > b:
            num = gcd(a, b)
        elif a < b:
            num = gcd(b, a)
        else:
            num = a
        d.append(num)
        m.append(int(a*b/num))
    except EOFError:
        break except EOFError:
        break break a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b if a > b:
            num = gcd(a, b)
        elif a < b:
            num = gcd(b, a)
        else:
            num = a
         a > b a b num = gcd(a, b) num gcd(a, b) gcd a b elif a < b:
            num = gcd(b, a)
         a < b a b num = gcd(b, a) num gcd(b, a) gcd b a num = a num a d.append(num) d.append d append num m.append(int(a*b/num)) m.append m append int(a*b/num) int a*b/num a*b a b num for i in range(len(d)):
    print(d[i], m[i]) i range(len(d)) range len(d) len d print(d[i], m[i]) print d[i] d i m[i] m i num = gcd(a, b) gcd(a, b) num a, b = map(int, input().split()) map(int, input().split()) a num = a a num d = [] [] d b = map(int, input().split()) map(int, input().split()) b m = [] [] m num = gcd(b, a) gcd(b, a) num def gcd(a, b):
    while b != 0:
        y = a % b
        a = b
        b = y
    return a def gcd(a, b):
    while b != 0:
        y = a % b
        a = b
        b = y
    return a gcd
def gcd(a, b):
    while b != 0:
        y = a % b
        a = b
        b = y
    return a


d = []
m = []
while True:
    try:
        a, b = map(int, input().split())
        if a > b:
            num = gcd(a, b)
        elif a < b:
            num = gcd(b, a)
        else:
            num = a
        d.append(num)
        m.append(int(a*b/num))
    except EOFError:
        break

for i in range(len(d)):
    print(d[i], m[i])