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

def lcm(a, m):
    return a * b / gcd(a, b);

while True:
    try:
        a, b = map(int, raw_input().split())
        print gcd(a, b), lcm(a, b)
    except (EOFError):
        break def gcd(a, b):
    if b == 0: return a
    else: return gcd(b, a % b) gcd if b == 0: return a
    else: return gcd(b, a % b) b == 0 b 0 a a b b def lcm(a, m):
    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 m m while True:
    try:
        a, b = map(int, raw_input().split())
        print gcd(a, b), lcm(a, b)
    except (EOFError):
        break True try:
        a, b = map(int, raw_input().split())
        print gcd(a, b), lcm(a, b)
    except (EOFError):
        break except (EOFError):
        break break a, b = map(int, raw_input().split()) a map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split b print gcd(a, b) gcd a b lcm(a, b) lcm a b def lcm(a, m):
    return a * b / gcd(a, b); def lcm(a, m):
    return a * b / gcd(a, b); lcm b = map(int, raw_input().split()) map(int, raw_input().split()) b a, b = map(int, raw_input().split()) map(int, raw_input().split()) a def gcd(a, b):
    if b == 0: return a
    else: return gcd(b, a % b) def gcd(a, b):
    if b == 0: return a
    else: return gcd(b, a % b) gcd
def gcd(a, b):
    if b == 0: return a
    else: return gcd(b, a % b)

def lcm(a, m):
    return a * b / gcd(a, b);

while True:
    try:
        a, b = map(int, raw_input().split())
        print gcd(a, b), lcm(a, b)
    except (EOFError):
        break