#include <iostream>
using namespace std;
int main()
{
   int a,b,d,e;
  cin>>a>>b;
  for(int i = a; i>0;i--){
    if(a%i== 0&& b%i == 0)
        d = i ;
}
 for(int j = a; j <= a*b;++j){
     if(j%a == 0&& j%b == 0){
       e =j;
     }
 }

 cout<<d<<" "<<e<<endl;
    return 0;
}