def cal(a,b)
    if a<b
     temp=b
     b=a
     a=temp
    end
    if a%b==0
     return b
    else
    return cal(b,a%b)
    end
end
def cal_min(a,b)
    mul=a*b
    max=cal(a,b)
    min=mul/max
return min
end
numbers1=gets.chomp.split(' ')
numbers2=gets.chomp.split(' ')
puts "#{cal(numbers1[0].to_i,numbers1[1].to_i)} #{cal_min(numbers1[0].to_i,numbers1[1].to_i)}"
puts "#{cal(numbers2[0].to_i,numbers2[1].to_i)} #{cal_min(numbers2[0].to_i,numbers2[1].to_i)}"