def gcd(a, b):
    while b:
        a, b = b, a % b

    return a


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


while True:
    try:
        x, y = map(int, input().split())
        print(gcd(x, y), lcm(x, y))
    except:
        break
 def gcd(a, b):
    while b:
        a, b = b, a % b

    return a gcd while b:
        a, b = b, a % b

     b a, b = b, a % b a b b a % b a b 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 while True:
    try:
        x, y = map(int, input().split())
        print(gcd(x, y), lcm(x, y))
    except:
        break True try:
        x, y = map(int, input().split())
        print(gcd(x, y), lcm(x, y))
    except:
        break except:
        break break x, y = map(int, input().split()) x map(int, input().split()) map int input().split() ().split () input split y print(gcd(x, y), lcm(x, y)) print gcd(x, y) gcd x y lcm(x, y) lcm x y def lcm(a, b):
    return a * b // gcd(a, b) def lcm(a, b):
    return a * b // gcd(a, b) lcm x, y = map(int, input().split()) map(int, input().split()) x def gcd(a, b):
    while b:
        a, b = b, a % b

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

    return a gcd y = map(int, input().split()) map(int, input().split()) y
def gcd(a, b):
    while b:
        a, b = b, a % b

    return a


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


while True:
    try:
        x, y = map(int, input().split())
        print(gcd(x, y), lcm(x, y))
    except:
        break

