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

int gcd(int a, int b){

int p,q,r;
if(a<b){p=b;b=a;a=p;

}
   while((r=b%a)!=0){
   q=b/a;
   b=a;
   a=r;
   }
   return a;
}

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