#include <iostream>
using namespace std;

 using namespace std;
 int gcd(int a, int b)
{
    
}



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