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

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

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

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

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