def gcd(m, n)
    if m < n 
        gcd(n, m)
    elsif n == 0
        m
    else
        gcd(n, m % n)
    end 
end

while gets
    x, y = $_.split.map(&:to_i)
    g = gcd(x, y)
    puts [g, x * y / g].join(" ")
end