# 最大公約数：ユークリッドの互除法
import sys

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

def get_input():
    data = []
    for line in sys.stdin:
        a, b = [int(i) for i in line.split()]
        data.append((a,b))
    return data


data = get_input()

for x,y in data:
    GCD = gcd(x,y)
    LCM = x*y // GCD
    print(GCD, LCM) import sys sys def gcd(x, y):
    return y if not x%y else gcd(y, x%y) gcd return y if not x%y else gcd(y, x%y) y if not x%y else gcd(y, x%y) not x%y x%y x y y gcd(y, x%y) gcd y x%y x y x x y y def get_input():
    data = []
    for line in sys.stdin:
        a, b = [int(i) for i in line.split()]
        data.append((a,b))
    return data get_input data = [] data [] for line in sys.stdin:
        a, b = [int(i) for i in line.split()]
        data.append((a,b))
     line sys.stdin sys stdin int(i) for i in line.split() for i in line.split() i line.split() line.split line split for i in line.split() int(i) int i a, b = [int(i) for i in line.split()] a [int(i) for i in line.split()] b data.append((a,b)) data.append data append (a,b) a b return data data data = get_input() data get_input() get_input for x,y in data:
    GCD = gcd(x,y)
    LCM = x*y // GCD
    print(GCD, LCM) x y data GCD = gcd(x,y) GCD gcd(x,y) gcd x y LCM = x*y // GCD LCM x*y // GCD x*y x y GCD print(GCD, LCM) print GCD LCM def get_input():
    data = []
    for line in sys.stdin:
        a, b = [int(i) for i in line.split()]
        data.append((a,b))
    return data def get_input():
    data = []
    for line in sys.stdin:
        a, b = [int(i) for i in line.split()]
        data.append((a,b))
    return data get_input data = get_input() get_input() data GCD = gcd(x,y) gcd(x,y) GCD LCM = x*y // GCD x*y // GCD LCM def gcd(x, y):
    return y if not x%y else gcd(y, x%y) def gcd(x, y):
    return y if not x%y else gcd(y, x%y) gcd
# 最大公約数：ユークリッドの互除法
import sys

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

def get_input():
    data = []
    for line in sys.stdin:
        a, b = [int(i) for i in line.split()]
        data.append((a,b))
    return data


data = get_input()

for x,y in data:
    GCD = gcd(x,y)
    LCM = x*y // GCD
    print(GCD, LCM)
