#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

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