#include <iostream>
using namespace std;

int gcd(int a, int b)
{
    if (a > b) {
        return gcd(b, a);
    }

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

int main()
{
    int a, b;
    while (cin >> a >> b) {
        int gcd_thereof = gcd(a, b);

        cout << gcd_thereof << " ";

        a /= gcd_thereof;
        b /= gcd_thereof;

        cout << a * b * gcd_thereof << endl;
    }
}