#encoding:utf-8
def find_the_LCM array #arrayの要素は文字
 array.length.times do |i|
  array[i] = array[i].to_i
 end
 i = 1
 while true
  if array[0]*i%array[1] == 0
   break
  end
  i += 1
 end
 return array[0]*i
end

def find_the_GCD array #arrayの要素は文字
 #ユークリッドの互除法を用いる 「アルゴリズムのキホン」p108参照
 array.length.times do |i|
  array[i] = array[i].to_i
 end
 x,y,r = array[0],array[1],array[0]%array[1]
 until r == 0
  x = y
  y = r
  r = x%y
 end
 return y
end

numbers = []
while true
 num = gets.chomp
 if num == ""
  break
 end
 numbers.push num.split
end

i = 0
while i < numbers.length
 print "#{find_the_GCD numbers[i]} #{find_the_LCM numbers[i]}\n"
 i += 1
end