import sys

def gcd(a, b):
    while b % a:
        a, b = b % a, a
    return a
def lcm(a, b):
    return a * b // gcd(a, b)

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

def gcd(a, b):
    while b % a:
        a, b = b % a, a
    return a
def lcm(a, b):
    return a * b // gcd(a, b)

for line in sys.stdin:
    a, b = sorted(list(map(int, line.split())))
    print(gcd(a, b), lcm(a, b))