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

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

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

    g = gcd(a, b) 
    print "{} {}".format(g, lcm(a,b,g))  def gcd(a, b):
    if a < b:
        a, b = b, a
    r = a % b
    if r == 0:
        return b
    else:
        return gcd(b, r) gcd if a < b:
        a, b = b, a
     a < b a b a, b = b, a a b b a r = a % b r a % b a b if r == 0:
        return b
    else:
        return gcd(b, r) r == 0 r 0 return b b return gcd(b, r) gcd(b, r) gcd b r a a b b def lcm(a, b, g):
    return a * b / g
     lcm return a * b / g a * b / g a * b a b g a a b b g g while True:
    try:
        a, b = map(int, raw_input().split())
    except EOFError:
        break

    g = gcd(a, b) 
    print "{} {}".format(g, lcm(a,b,g))  True try:
        a, b = map(int, raw_input().split())
    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 g = gcd(a, b) g gcd(a, b) gcd a b print "{} {}".format(g, lcm(a,b,g)) "{} {}".format "{} {}" format g lcm(a,b,g) lcm a b g def lcm(a, b, g):
    return a * b / g
     def lcm(a, b, g):
    return a * b / g
     lcm def gcd(a, b):
    if a < b:
        a, b = b, a
    r = a % b
    if r == 0:
        return b
    else:
        return gcd(b, r) def gcd(a, b):
    if a < b:
        a, b = b, a
    r = a % b
    if r == 0:
        return b
    else:
        return gcd(b, r) gcd b = map(int, raw_input().split()) map(int, raw_input().split()) b g = gcd(a, b) gcd(a, b) g a, b = map(int, raw_input().split()) map(int, raw_input().split()) a

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

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

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

    g = gcd(a, b) 
    print "{} {}".format(g, lcm(a,b,g)) 