import sys
import math

a = []
for line in sys.stdin:
    a.append(line)

for n in a:
    inl=n.split()
    num1=int(inl[0])
    check=1
    list=[]
    while check<=math.sqrt(num1):
        if num1%check==0:
            list.append(check)
            list.append(num1/check)
        check+=1
    list.sort()
    list.reverse()
    num2=int(inl[1])
    for i in list:
        if num2%i==0:
            gud=i
            break
    lcm=num1*num2/gud
    print gud,lcm import sys sys import math math a = [] a [] for line in sys.stdin:
    a.append(line) line sys.stdin sys stdin a.append(line) a.append a append line for n in a:
    inl=n.split()
    num1=int(inl[0])
    check=1
    list=[]
    while check<=math.sqrt(num1):
        if num1%check==0:
            list.append(check)
            list.append(num1/check)
        check+=1
    list.sort()
    list.reverse()
    num2=int(inl[1])
    for i in list:
        if num2%i==0:
            gud=i
            break
    lcm=num1*num2/gud
    print gud,lcm n a inl=n.split() inl n.split() n.split n split num1=int(inl[0]) num1 int(inl[0]) int inl[0] inl 0 check=1 check 1 list=[] list [] while check<=math.sqrt(num1):
        if num1%check==0:
            list.append(check)
            list.append(num1/check)
        check+=1
     check<=math.sqrt(num1) check math.sqrt(num1) math.sqrt math sqrt num1 if num1%check==0:
            list.append(check)
            list.append(num1/check)
         num1%check==0 num1%check num1 check 0 list.append(check) list.append list append check list.append(num1/check) list.append list append num1/check num1 check check+=1 check 1 list.sort() list.sort list sort list.reverse() list.reverse list reverse num2=int(inl[1]) num2 int(inl[1]) int inl[1] inl 1 for i in list:
        if num2%i==0:
            gud=i
            break
     i list if num2%i==0:
            gud=i
            break
     num2%i==0 num2%i num2 i 0 gud=i gud i break lcm=num1*num2/gud lcm num1*num2/gud num1*num2 num1 num2 gud print gud lcm a = [] [] a inl=n.split() n.split() inl num1=int(inl[0]) int(inl[0]) num1 list=[] [] list check+=1 1 check num2=int(inl[1]) int(inl[1]) num2 gud=i i gud check=1 1 check lcm=num1*num2/gud num1*num2/gud lcm
import sys
import math

a = []
for line in sys.stdin:
    a.append(line)

for n in a:
    inl=n.split()
    num1=int(inl[0])
    check=1
    list=[]
    while check<=math.sqrt(num1):
        if num1%check==0:
            list.append(check)
            list.append(num1/check)
        check+=1
    list.sort()
    list.reverse()
    num2=int(inl[1])
    for i in list:
        if num2%i==0:
            gud=i
            break
    lcm=num1*num2/gud
    print gud,lcm