def gcd(a,b)
    loop {
        if b == 0
            return a
        end
        a, b = b, a % b
    }
end

STDIN.each_line {|l| 
    a,b = l.split().map {|v| v.to_i }
    g = gcd(a,b)
    print "%d %d\n" % [g, (a * b)/g]
}