#include <iostream>
#include <cstdio>
using namespace std;

int gcd(int a, int b) {
    int r;
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}

int main(void){
   int a, b, tmp;
   if (a < b){
    tmp = b;
	b = a;
	a = tmp;

   }
   (cin >> a >> b);
     int lcm = b * a / gcd(a,b);
     cout << gcd(a,b) << " " << lcm << endl;
   
   return 0;
}
