#include <iostream>
#include <iomanip>
using namespace std;

int GCD(int a, int b)
{
    int c = (a < b)? a : b;
    for (int i = 1; i <= c; ++i) {
        int d = c / i;
        if ( a % d + b % d == 0)
            return d;
    }
    return 1;
}

int LCM(int a, int b)
{
    int c = (a < b)? b : a;
    for (int i = 1; c * i <= 2000000000; ++i) {
        int d = c * i;
        if (d % a + d % b == 0)
            return d;
    }
    return -1;
}

int main(void)
{
    int a, b;
    while (cin >> a >> b)
        cout << GCD(a, b) << " " << LCM(a, b) << endl;
    return 0;
}





