#include <iostream>

int main()
{
        int a, b, t, GCD;
        while(std::cin >> a >> b)
        {
                t = a, GCD = b;
                while(t != GCD)
                        if(t > GCD)
                                t -= GCD;
                        else
                                GCD -= t;
                std::cout << GCD << " " << (a / GCD)*b << std::endl;
        }
        return 0;
}