import sys

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

for line in sys.stdin.readlines():
    a, b = map(int, line.split())
    print(gcd(a, b), a * b // gcd(a, b)) import sys sys def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b) gcd if b == 0:
        return a
     b == 0 b 0 return a a return gcd(b, a % b) gcd(b, a % b) gcd b a % b a b a a b b for line in sys.stdin.readlines():
    a, b = map(int, line.split())
    print(gcd(a, b), a * b // gcd(a, b)) line sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin 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), a * b // gcd(a, b)) print gcd(a, b) gcd a b a * b // gcd(a, b) a * b a b gcd(a, b) gcd a b b = map(int, line.split()) map(int, line.split()) b def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b) def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b) gcd a, b = map(int, line.split()) map(int, line.split()) a
import sys

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

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