array = gets.split
cd = 1

while cd < array[0].to_i
 if array[0].to_i%cd == 0 && array[1].to_i%cd == 0
  gcd = cd
 end
 cd = cd +1
end

i = 1
while true
 number = array[0].to_i*i
 if number%array[1].to_i == 0
  lcm = number
  break
 elsif
  i = i+1
 end
end

puts "#{gcd} #{lcm}"