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

for line in open(0).readlines():
    a, b = map(int, line.split())
    print(gcd(a, b), lcm(a, b))
 def gcd(m, n):
    while n:
        m, n = n, m % n
    return m gcd while n:
        m, n = n, m % n
     n m, n = n, m % n m n n m % n m n return m m m m n n def lcm(m, n):
    return m // gcd(m, n) * n lcm return m // gcd(m, n) * n m // gcd(m, n) * n m // gcd(m, n) m gcd(m, n) gcd m n n m m n n for line in open(0).readlines():
    a, b = map(int, line.split())
    print(gcd(a, b), lcm(a, b)) line open(0).readlines() (0).readlines (0) open 0 readlines a, b = map(int, line.split()) a map(int, line.split()) map int line.split() line.split line split b print(gcd(a, b), lcm(a, b)) print gcd(a, b) gcd a b lcm(a, b) lcm a b def gcd(m, n):
    while n:
        m, n = n, m % n
    return m def gcd(m, n):
    while n:
        m, n = n, m % n
    return m gcd def lcm(m, n):
    return m // gcd(m, n) * n def lcm(m, n):
    return m // gcd(m, n) * n lcm b = map(int, line.split()) map(int, line.split()) b a, b = map(int, line.split()) map(int, line.split()) a
def gcd(m, n):
    while n:
        m, n = n, m % n
    return m
def lcm(m, n):
    return m // gcd(m, n) * n

for line in open(0).readlines():
    a, b = map(int, line.split())
    print(gcd(a, b), lcm(a, b))

