def gcd(a, b):
    return gcd(b, a%b) if b else a
    
while True:
    try:
        a, b = map(int, raw_input().split())
        ans = gcd(a, b)
        print ans, a*b//ans
    except EOFError:
        break def gcd(a, b):
    return gcd(b, a%b) if b else a
     gcd return gcd(b, a%b) if b else a gcd(b, a%b) if b else a b gcd(b, a%b) gcd b a%b a b a a a b b while True:
    try:
        a, b = map(int, raw_input().split())
        ans = gcd(a, b)
        print ans, a*b//ans
    except EOFError:
        break True try:
        a, b = map(int, raw_input().split())
        ans = gcd(a, b)
        print ans, a*b//ans
    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 ans = gcd(a, b) ans gcd(a, b) gcd a b print ans a*b//ans a*b a b ans ans = gcd(a, b) gcd(a, b) ans a, b = map(int, raw_input().split()) map(int, raw_input().split()) a def gcd(a, b):
    return gcd(b, a%b) if b else a
     def gcd(a, b):
    return gcd(b, a%b) if b else a
     gcd b = map(int, raw_input().split()) map(int, raw_input().split()) b
def gcd(a, b):
    return gcd(b, a%b) if b else a
    
while True:
    try:
        a, b = map(int, raw_input().split())
        ans = gcd(a, b)
        print ans, a*b//ans
    except EOFError:
        break