while line=$stdin.gets do
    a,b=line.split(" ").collect{|x| x.to_i}

    c=a

    d=b

    if c<d

        c,d=d,c

    end

    while d!=0

        c,d=d,c%d

    end

    $stdout.print c," ",(a*b)/c,"\n"
end