import sys

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

for line in sys.stdin.readlines():
    m, n = map(int, line.split())
    g = gcd(m, n)
    l = m * n // g    # LCM
    print(g, l) import sys sys def gcd(m, n):
    if n != 0:
        return gcd(n, m % n)
    else:
        return m gcd if n != 0:
        return gcd(n, m % n)
    else:
        return m n != 0 n 0 return gcd(n, m % n) gcd(n, m % n) gcd n m % n m n return m m m m n n for line in sys.stdin.readlines():
    m, n = map(int, line.split())
    g = gcd(m, n)
    l = m * n // g    # LCM
    print(g, l) line sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines m, n = map(int, line.split()) m map(int, line.split()) map int line.split() line.split line split n g = gcd(m, n) g gcd(m, n) gcd m n l = m * n // g l m * n // g m * n m n g print(g, l) print g l g = gcd(m, n) gcd(m, n) g l = m * n // g m * n // g l n = map(int, line.split()) map(int, line.split()) n def gcd(m, n):
    if n != 0:
        return gcd(n, m % n)
    else:
        return m def gcd(m, n):
    if n != 0:
        return gcd(n, m % n)
    else:
        return m gcd m, n = map(int, line.split()) map(int, line.split()) m
import sys

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

for line in sys.stdin.readlines():
    m, n = map(int, line.split())
    g = gcd(m, n)
    l = m * n // g    # LCM
    print(g, l)