#include <iostream>

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

int main()
{
    while (true) {
        int a, b;
        std::cin >> a >> b;
        if (std::cin.eof()) break;
        int g = gcd(a, b);
        std::cout << g << " " << a / g * b << std::endl;
    }
}