#include<iostream>
typedef long long ll;
using namespace std;

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



ll a, b;

int main() {
    
    while (cin >> a >> b) {
        ll g = gcd(a,b);
        cout << g << " " << a * b / g << "\n";
    }

}
