#encoding:utf-8 No.0005 2014.9.29
def lcm(a,b) #最小公倍数を求めるメソッド
 i = 1
 while true
  if (a*i)%b == 0
   break
  end
 i += 1
 end
 return a*i
end

def gcd(a,b) #最大公約数を求めるメソッド
 if a > b
  x,y = a,b
 else
  x,y = b,a
 end
 r = x%y

 until r == 0
  x = y
  y = r
  r = x%y
 end

 return y
end

numbers = []
while true
 data = gets.split
 if data == []
  break
 end

 2.times do |i|
  data[i] = data[i].to_i
 end

 numbers.push data
end

i = 0
while i < numbers.length
 puts "#{gcd(numbers[i][0],numbers[i][1])} #{lcm(numbers[i][0],numbers[i][1])}"
 i += 1
end