import sys
for i in sys.stdin:
    m, n = map(int, i.split())
    t1, t2 = m, n
    while True:
        if m % n == 0:
            break
        m, n = n, m % n
    a = n
    b = (t1/ a) * t2
    print("{} {}".format(a, b)) import sys sys for i in sys.stdin:
    m, n = map(int, i.split())
    t1, t2 = m, n
    while True:
        if m % n == 0:
            break
        m, n = n, m % n
    a = n
    b = (t1/ a) * t2
    print("{} {}".format(a, b)) i sys.stdin sys stdin m, n = map(int, i.split()) m map(int, i.split()) map int i.split() i.split i split n t1, t2 = m, n t1 m t2 n while True:
        if m % n == 0:
            break
        m, n = n, m % n
     True if m % n == 0:
            break
         m % n == 0 m % n m n 0 break m, n = n, m % n m n n m % n m n a = n a n b = (t1/ a) * t2 b (t1/ a) * t2 t1/ a t1 a t2 print("{} {}".format(a, b)) print "{} {}".format(a, b) "{} {}".format "{} {}" format a b m, n = map(int, i.split()) map(int, i.split()) m n = n, m % n m % n n n = map(int, i.split()) map(int, i.split()) n b = (t1/ a) * t2 (t1/ a) * t2 b t1, t2 = m, n m t1 m, n = n, m % n n m a = n n a t2 = m, n n t2
import sys
for i in sys.stdin:
    m, n = map(int, i.split())
    t1, t2 = m, n
    while True:
        if m % n == 0:
            break
        m, n = n, m % n
    a = n
    b = (t1/ a) * t2
    print("{} {}".format(a, b))