#include <iostream>

int main()
{
    int a, b;
    while (std::cin >> a >> b) {
        if (b > a) {
            int tmp = a;
            a = b;
            b = tmp;
        }

        int m = a;
        int n = b;

        while (n != 0) {
            int tmp = n;
            n = m % n;
            m = tmp;
        }
        std::cout << m << " "<< (a * b / m) << std::endl;
    }

    return 0;
}