def gcd(a, b):
    while(b > 0):
        a, b = b, a % b
    return a
import sys
for line in sys.stdin:
    a, b = map(int, line.split())
    g = gcd(a, b)
    print(g, a * b // g) def gcd(a, b):
    while(b > 0):
        a, b = b, a % b
    return a gcd while(b > 0):
        a, b = b, a % b
     b > 0 b 0 a, b = b, a % b a b b a % b a b return a a a a b b import sys sys for line in sys.stdin:
    a, b = map(int, line.split())
    g = gcd(a, b)
    print(g, a * b // g) line sys.stdin sys stdin a, b = map(int, line.split()) a map(int, line.split()) map int line.split() line.split line split b g = gcd(a, b) g gcd(a, b) gcd a b print(g, a * b // g) print g a * b // g a * b a b g a, b = map(int, line.split()) map(int, line.split()) a b = map(int, line.split()) map(int, line.split()) b def gcd(a, b):
    while(b > 0):
        a, b = b, a % b
    return a def gcd(a, b):
    while(b > 0):
        a, b = b, a % b
    return a gcd g = gcd(a, b) gcd(a, b) g
def gcd(a, b):
    while(b > 0):
        a, b = b, a % b
    return a
import sys
for line in sys.stdin:
    a, b = map(int, line.split())
    g = gcd(a, b)
    print(g, a * b // g)