def GCD(a, b):
    if b == 0:
        return a
    return GCD(b, a % b)

def LCM(a, b):
    return a * b // GCD(a, b)

import sys
s = sys.stdin.readlines()
n = len(s)
for i in range(n):
    x, y = map(int, s[i].split())
    print(GCD(x, y), LCM(x, y))
 def GCD(a, b):
    if b == 0:
        return a
    return GCD(b, a % b) GCD if b == 0:
        return a
     b == 0 b 0 return a a return GCD(b, a % b) GCD(b, a % b) GCD b a % b a b a a b b def LCM(a, b):
    return a * b // GCD(a, b) LCM return a * b // GCD(a, b) a * b // GCD(a, b) a * b a b GCD(a, b) GCD a b a a b b import sys sys s = sys.stdin.readlines() s sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines n = len(s) n len(s) len s for i in range(n):
    x, y = map(int, s[i].split())
    print(GCD(x, y), LCM(x, y)) i range(n) range n x, y = map(int, s[i].split()) x map(int, s[i].split()) map int s[i].split() [i].split [i] s i split y print(GCD(x, y), LCM(x, y)) print GCD(x, y) GCD x y LCM(x, y) LCM x y s = sys.stdin.readlines() sys.stdin.readlines() s def LCM(a, b):
    return a * b // GCD(a, b) def LCM(a, b):
    return a * b // GCD(a, b) LCM x, y = map(int, s[i].split()) map(int, s[i].split()) x n = len(s) len(s) n y = map(int, s[i].split()) map(int, s[i].split()) y def GCD(a, b):
    if b == 0:
        return a
    return GCD(b, a % b) def GCD(a, b):
    if b == 0:
        return a
    return GCD(b, a % b) GCD
def GCD(a, b):
    if b == 0:
        return a
    return GCD(b, a % b)

def LCM(a, b):
    return a * b // GCD(a, b)

import sys
s = sys.stdin.readlines()
n = len(s)
for i in range(n):
    x, y = map(int, s[i].split())
    print(GCD(x, y), LCM(x, y))

