#include<iostream>
using namespace std;

int main(void){
     long int n,m;
     long int c,e;
     long int l;
     cin >> n >> m;
     c = n;
     e = m;
     while(1){
	  if(c==e){
	       break;
	  }else if(c>e){
	       c = c-e;
	  }else if(c<e){
	       e = e-c;
	  }
     }
     l = (n*m)/c;
     cout << c << " " << l << endl;
     return 0;
}