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

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

import fileinput
import math
for line in fileinput.input():
    a, b = map(int, line.split())
    g = gcd(a, b)
    lcm = a * b // g
    print(g, lcm)