import sys
list = sys.stdin.readlines()

e=0
GCD = 0
def Euclide(a, b):
    if b == 0:
        return a
    if a < b:
        tmp = a
        a = b
        b = tmp
    e = a%b
    return Euclide(b, e)

for i in list:
    i = i.split(' ')
    GCD = Euclide(int(i[0]), int(i[1]))
    print(str(GCD)+" "+str(int(int(i[0])/GCD*int(i[1])))) import sys sys list = sys.stdin.readlines() list sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines e=0 e 0 GCD = 0 GCD 0 def Euclide(a, b):
    if b == 0:
        return a
    if a < b:
        tmp = a
        a = b
        b = tmp
    e = a%b
    return Euclide(b, e) Euclide if b == 0:
        return a
     b == 0 b 0 return a a if a < b:
        tmp = a
        a = b
        b = tmp
     a < b a b tmp = a tmp a a = b a b b = tmp b tmp e = a%b e a%b a b return Euclide(b, e) Euclide(b, e) Euclide b e a a b b for i in list:
    i = i.split(' ')
    GCD = Euclide(int(i[0]), int(i[1]))
    print(str(GCD)+" "+str(int(int(i[0])/GCD*int(i[1])))) i list i = i.split(' ') i i.split(' ') i.split i split ' ' GCD = Euclide(int(i[0]), int(i[1])) GCD Euclide(int(i[0]), int(i[1])) Euclide int(i[0]) int i[0] i 0 int(i[1]) int i[1] i 1 print(str(GCD)+" "+str(int(int(i[0])/GCD*int(i[1])))) print str(GCD)+" "+str(int(int(i[0])/GCD*int(i[1]))) str(GCD)+" " str(GCD) str GCD " " str(int(int(i[0])/GCD*int(i[1]))) str int(int(i[0])/GCD*int(i[1])) int int(i[0])/GCD*int(i[1]) int(i[0])/GCD int(i[0]) int i[0] i 0 GCD int(i[1]) int i[1] i 1 def Euclide(a, b):
    if b == 0:
        return a
    if a < b:
        tmp = a
        a = b
        b = tmp
    e = a%b
    return Euclide(b, e) def Euclide(a, b):
    if b == 0:
        return a
    if a < b:
        tmp = a
        a = b
        b = tmp
    e = a%b
    return Euclide(b, e) Euclide GCD = Euclide(int(i[0]), int(i[1])) Euclide(int(i[0]), int(i[1])) GCD list = sys.stdin.readlines() sys.stdin.readlines() list GCD = 0 0 GCD i = i.split(' ') i.split(' ') i e=0 0 e
import sys
list = sys.stdin.readlines()

e=0
GCD = 0
def Euclide(a, b):
    if b == 0:
        return a
    if a < b:
        tmp = a
        a = b
        b = tmp
    e = a%b
    return Euclide(b, e)

for i in list:
    i = i.split(' ')
    GCD = Euclide(int(i[0]), int(i[1]))
    print(str(GCD)+" "+str(int(int(i[0])/GCD*int(i[1]))))