import math
while True:
    try:
        a,b=map(int,input().split())
        print(*[math.gcd(a,b),a*b//math.gcd(a,b)])
    except:break import math math while True:
    try:
        a,b=map(int,input().split())
        print(*[math.gcd(a,b),a*b//math.gcd(a,b)])
    except:break True try:
        a,b=map(int,input().split())
        print(*[math.gcd(a,b),a*b//math.gcd(a,b)])
    except:break except:b a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b print(*[math.gcd(a,b),a*b//math.gcd(a,b)]) print *[math.gcd(a,b),a*b//math.gcd(a,b)] [math.gcd(a,b),a*b//math.gcd(a,b)] 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=map(int,input().split()) map(int,input().split()) a b=map(int,input().split()) map(int,input().split()) b
import math
while True:
    try:
        a,b=map(int,input().split())
        print(*[math.gcd(a,b),a*b//math.gcd(a,b)])
    except:break
