import math
while True:
    try:
        a,b=map(int,input().split())
        gcd=math.gcd(a,b)
        lcm=int(a*b/gcd)
        print(gcd, lcm)
    except:break
 import math math while True:
    try:
        a,b=map(int,input().split())
        gcd=math.gcd(a,b)
        lcm=int(a*b/gcd)
        print(gcd, lcm)
    except:break True try:
        a,b=map(int,input().split())
        gcd=math.gcd(a,b)
        lcm=int(a*b/gcd)
        print(gcd, lcm)
    except:break except:b a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b gcd=math.gcd(a,b) gcd math.gcd(a,b) math.gcd math gcd a b lcm=int(a*b/gcd) lcm int(a*b/gcd) int a*b/gcd a*b a b gcd print(gcd, lcm) print gcd lcm lcm=int(a*b/gcd) int(a*b/gcd) lcm b=map(int,input().split()) map(int,input().split()) b a,b=map(int,input().split()) map(int,input().split()) a gcd=math.gcd(a,b) math.gcd(a,b) gcd
import math
while True:
    try:
        a,b=map(int,input().split())
        gcd=math.gcd(a,b)
        lcm=int(a*b/gcd)
        print(gcd, lcm)
    except:break

