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

while line = gets
    m, n = line.split.map(&:to_i)
    gcd = gcd(m, n)
    lcm = m * n / gcd
    puts "#{gcd} #{lcm}"
end