import fractions
while 1:
    try:
        a,b=map(int,input().split())
        c=fractions.gcd(a,b)
        print(c,(a*b)//c)
    except:break import fractions fractions while 1:
    try:
        a,b=map(int,input().split())
        c=fractions.gcd(a,b)
        print(c,(a*b)//c)
    except:break 1 try:
        a,b=map(int,input().split())
        c=fractions.gcd(a,b)
        print(c,(a*b)//c)
    except:break except:break a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b c=fractions.gcd(a,b) c fractions.gcd(a,b) fractions.gcd fractions gcd a b print(c,(a*b)//c) print c (a*b)//c a*b a b c a,b=map(int,input().split()) map(int,input().split()) a c=fractions.gcd(a,b) fractions.gcd(a,b) c b=map(int,input().split()) map(int,input().split()) b
import fractions
while 1:
    try:
        a,b=map(int,input().split())
        c=fractions.gcd(a,b)
        print(c,(a*b)//c)
    except:break