#include <iostream>
#include <algorithm>

const int gcd(const int a, const int b)
{
    if(a % b == 0)
    {
        return b;
    }

    return gcd(b, a % b);
}

const int lcm(const int a, const int b,  const int g)
{
    return (a / g) * b;
}

int main(void)
{
    int a, b;

    while(std::cin >> a >> b)
    {
        if(a < b)
        {
            std::swap(a, b);
        }
    
        const int g = gcd(a, b);
        const int l = lcm(a, b, g);
    
        std::cout << g << " " << l << std::endl;
    }

    return 0;
}