import math

while True:
    try:
        a, b = [int(x) for x in input().split()]
        print(math.gcd(a,b), a*b // math.gcd(a,b))
    except EOFError:
        break
     import math math while True:
    try:
        a, b = [int(x) for x in input().split()]
        print(math.gcd(a,b), a*b // math.gcd(a,b))
    except EOFError:
        break
     True try:
        a, b = [int(x) for x in input().split()]
        print(math.gcd(a,b), a*b // math.gcd(a,b))
    except EOFError:
        break
     except EOFError:
        break
     break int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x a, b = [int(x) for x in input().split()] a [int(x) for x in input().split()] b print(math.gcd(a,b), a*b // math.gcd(a,b)) print math.gcd(a,b) math.gcd math gcd a b a*b // math.gcd(a,b) a*b a b math.gcd(a,b) math.gcd math gcd a b a, b = [int(x) for x in input().split()] [int(x) for x in input().split()] a b = [int(x) for x in input().split()] [int(x) for x in input().split()] b
import math

while True:
    try:
        a, b = [int(x) for x in input().split()]
        print(math.gcd(a,b), a*b // math.gcd(a,b))
    except EOFError:
        break
    
