def gcd(li):
    a=max(li)
    b=min(li)
    while b>0:
        a,b=b,a%b
    return a

def lcm(li):
    return li[0]*li[1]/gcd(li)

while True:
    try:
        li=[int(i) for i in input().split(" ")]
        print("%i %i"%(gcd(li),lcm(li)))
    except:break def gcd(li):
    a=max(li)
    b=min(li)
    while b>0:
        a,b=b,a%b
    return a gcd a=max(li) a max(li) max li b=min(li) b min(li) min li while b>0:
        a,b=b,a%b
     b>0 b 0 a,b=b,a%b a b b a%b a b return a a li li def lcm(li):
    return li[0]*li[1]/gcd(li) lcm return li[0]*li[1]/gcd(li) li[0]*li[1]/gcd(li) li[0]*li[1] li[0] li 0 li[1] li 1 gcd(li) gcd li li li while True:
    try:
        li=[int(i) for i in input().split(" ")]
        print("%i %i"%(gcd(li),lcm(li)))
    except:break True try:
        li=[int(i) for i in input().split(" ")]
        print("%i %i"%(gcd(li),lcm(li)))
    except:break except:break int(i) for i in input().split(" ") for i in input().split(" ") i input().split(" ") ().split () input split " " for i in input().split(" ") int(i) int i li=[int(i) for i in input().split(" ")] li [int(i) for i in input().split(" ")] print("%i %i"%(gcd(li),lcm(li))) print "%i %i"%(gcd(li),lcm(li)) "%i %i" (gcd(li),lcm(li)) gcd(li) gcd li lcm(li) lcm li def gcd(li):
    a=max(li)
    b=min(li)
    while b>0:
        a,b=b,a%b
    return a def gcd(li):
    a=max(li)
    b=min(li)
    while b>0:
        a,b=b,a%b
    return a gcd li=[int(i) for i in input().split(" ")] [int(i) for i in input().split(" ")] li def lcm(li):
    return li[0]*li[1]/gcd(li) def lcm(li):
    return li[0]*li[1]/gcd(li) lcm
def gcd(li):
    a=max(li)
    b=min(li)
    while b>0:
        a,b=b,a%b
    return a

def lcm(li):
    return li[0]*li[1]/gcd(li)

while True:
    try:
        li=[int(i) for i in input().split(" ")]
        print("%i %i"%(gcd(li),lcm(li)))
    except:break