import sys
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(a, b,gcdnum=0):
    if gcdnum==0:
        return a * b // gcd (a, b)
    else:
        return a * b // gcdnum

for line in sys.stdin:
    a,b = map(int,line.split())
    gcdnum = gcd(a,b)
    print "%d %d"%(gcdnum,lcm(a,b,gcdnum)) import sys sys def gcd(a, b):
    while b:
        a, b = b, a % b
    return a gcd while b:
        a, b = b, a % b
     b a, b = b, a % b a b b a % b a b return a a a a b b def lcm(a, b,gcdnum=0):
    if gcdnum==0:
        return a * b // gcd (a, b)
    else:
        return a * b // gcdnum lcm if gcdnum==0:
        return a * b // gcd (a, b)
    else:
        return a * b // gcdnum gcdnum==0 gcdnum 0 return a * b // gcd (a, b) a * b // gcd (a, b) a * b a b gcd (a, b) gcd a b return a * b // gcdnum a * b // gcdnum a * b a b gcdnum a a b b gcdnum=0 gcdnum 0 for line in sys.stdin:
    a,b = map(int,line.split())
    gcdnum = gcd(a,b)
    print "%d %d"%(gcdnum,lcm(a,b,gcdnum)) line sys.stdin sys stdin a,b = map(int,line.split()) a map(int,line.split()) map int line.split() line.split line split b gcdnum = gcd(a,b) gcdnum gcd(a,b) gcd a b print "%d %d"%(gcdnum,lcm(a,b,gcdnum)) "%d %d" (gcdnum,lcm(a,b,gcdnum)) gcdnum lcm(a,b,gcdnum) lcm a b gcdnum def lcm(a, b,gcdnum=0):
    if gcdnum==0:
        return a * b // gcd (a, b)
    else:
        return a * b // gcdnum def lcm(a, b,gcdnum=0):
    if gcdnum==0:
        return a * b // gcd (a, b)
    else:
        return a * b // gcdnum lcm a,b = map(int,line.split()) map(int,line.split()) a b = map(int,line.split()) map(int,line.split()) b gcdnum = gcd(a,b) gcd(a,b) gcdnum def gcd(a, b):
    while b:
        a, b = b, a % b
    return a def gcd(a, b):
    while b:
        a, b = b, a % b
    return a gcd
import sys
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(a, b,gcdnum=0):
    if gcdnum==0:
        return a * b // gcd (a, b)
    else:
        return a * b // gcdnum

for line in sys.stdin:
    a,b = map(int,line.split())
    gcdnum = gcd(a,b)
    print "%d %d"%(gcdnum,lcm(a,b,gcdnum))