import sys


def gcd(n, m):
    while m:
        n, m = m, n % m
    return n


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

for line in sys.stdin:
    l = line.replace('\n', '')
    a, b = l.split()
    a = int(a)
    b = int(b)
    print(gcd(a, b), lcm(a, b)) import sys sys def gcd(n, m):
    while m:
        n, m = m, n % m
    return n gcd while m:
        n, m = m, n % m
     m n, m = m, n % m n m m n % m n m return n n n n m m def lcm(x, y):
    return int((x * y) / gcd(x, y)) lcm return int((x * y) / gcd(x, y)) int((x * y) / gcd(x, y)) int (x * y) / gcd(x, y) x * y x y gcd(x, y) gcd x y x x y y for line in sys.stdin:
    l = line.replace('\n', '')
    a, b = l.split()
    a = int(a)
    b = int(b)
    print(gcd(a, b), lcm(a, b)) line sys.stdin sys stdin l = line.replace('\n', '') l line.replace('\n', '') line.replace line replace '\n' '' a, b = l.split() a l.split() l.split l split b a = int(a) a int(a) int a b = int(b) b int(b) int b print(gcd(a, b), lcm(a, b)) print gcd(a, b) gcd a b lcm(a, b) lcm a b a = int(a) int(a) a def gcd(n, m):
    while m:
        n, m = m, n % m
    return n def gcd(n, m):
    while m:
        n, m = m, n % m
    return n gcd b = int(b) int(b) b def lcm(x, y):
    return int((x * y) / gcd(x, y)) def lcm(x, y):
    return int((x * y) / gcd(x, y)) lcm l = line.replace('\n', '') line.replace('\n', '') l a, b = l.split() l.split() a b = l.split() l.split() b
import sys


def gcd(n, m):
    while m:
        n, m = m, n % m
    return n


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

for line in sys.stdin:
    l = line.replace('\n', '')
    a, b = l.split()
    a = int(a)
    b = int(b)
    print(gcd(a, b), lcm(a, b))