#include <iostream>
using namespace std;

long a, b, g;

long gcd(long a, long b)
{
    if (a < b) swap(a, b);
    if (b == 0) return a;
    return gcd(b, a % b);
}

int main()
{
    while (cin >> a >> b) {
        g = gcd(a, b);
        cout << g << " " << (a * b / g) << endl;
    }
    return 0;
}

