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

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


while True:
    try:
        a, b = [int(i) for i in input().split()]
        print(gcd(a, b), lcm(a, b))
    except EOFError:
        break 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 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 while True:
    try:
        a, b = [int(i) for i in input().split()]
        print(gcd(a, b), lcm(a, b))
    except EOFError:
        break True try:
        a, b = [int(i) for i in input().split()]
        print(gcd(a, b), lcm(a, b))
    except EOFError:
        break except EOFError:
        break break int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i a, b = [int(i) for i in input().split()] a [int(i) for i in input().split()] b print(gcd(a, b), lcm(a, b)) print gcd(a, b) gcd a b lcm(a, b) lcm a b b = [int(i) for i in input().split()] [int(i) for i in input().split()] b a, b = [int(i) for i in input().split()] [int(i) for i in input().split()] a 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 def lcm(a, b):
    return (a * b) // gcd(a,b) def lcm(a, b):
    return (a * b) // gcd(a,b) lcm
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

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


while True:
    try:
        a, b = [int(i) for i in input().split()]
        print(gcd(a, b), lcm(a, b))
    except EOFError:
        break