#include <iostream>
using namespace std;

typedef long long ll;

ll gcd(ll num1, ll num2){ return num2 == 0?num1:gcd(num2, num1 % num2); }
ll lcm(ll num1, ll num2){ return num1 * num2 / gcd(num1, num2); }

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