import sys

def gcd(m, n):
    r = m % n
    if r == 0:
        return n
    else:
        return gcd(n, r)

lines = sys.stdin.readlines()
for line in lines:
    a, b = map(int, line.split())
    m = max(a, b)
    n = min(a, b)
    print(gcd(m, n), m * n // gcd(m, n)) import sys sys def gcd(m, n):
    r = m % n
    if r == 0:
        return n
    else:
        return gcd(n, r) gcd r = m % n r m % n m n if r == 0:
        return n
    else:
        return gcd(n, r) r == 0 r 0 return n n return gcd(n, r) gcd(n, r) gcd n r m m n n lines = sys.stdin.readlines() lines sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines for line in lines:
    a, b = map(int, line.split())
    m = max(a, b)
    n = min(a, b)
    print(gcd(m, n), m * n // gcd(m, n)) line lines a, b = map(int, line.split()) a map(int, line.split()) map int line.split() line.split line split b m = max(a, b) m max(a, b) max a b n = min(a, b) n min(a, b) min a b print(gcd(m, n), m * n // gcd(m, n)) print gcd(m, n) gcd m n m * n // gcd(m, n) m * n m n gcd(m, n) gcd m n b = map(int, line.split()) map(int, line.split()) b lines = sys.stdin.readlines() sys.stdin.readlines() lines a, b = map(int, line.split()) map(int, line.split()) a n = min(a, b) min(a, b) n def gcd(m, n):
    r = m % n
    if r == 0:
        return n
    else:
        return gcd(n, r) def gcd(m, n):
    r = m % n
    if r == 0:
        return n
    else:
        return gcd(n, r) gcd m = max(a, b) max(a, b) m
import sys

def gcd(m, n):
    r = m % n
    if r == 0:
        return n
    else:
        return gcd(n, r)

lines = sys.stdin.readlines()
for line in lines:
    a, b = map(int, line.split())
    m = max(a, b)
    n = min(a, b)
    print(gcd(m, n), m * n // gcd(m, n))