#include <iostream>

int main()
{
    long large, small;
    long a, b, tmp;
    while (std::cin >> a >> b) {
        if (a < b) {
            tmp = a;
            a = b;
            b = tmp;
        }
        large = a;
        small = b;
        while (small != 0) {
            tmp = small;
            small = large - (large / small) * small;
            large = tmp;
        }
        std::cout << large << " " << a * b / large << std::endl;
    }
    return 0;
}