#include<iostream>
using namespace std;

int main(){
const int INF=1000000;
int a[INF];
int gcd,lcm;
while(cin>>a[0]>>a[1]){
for(int i=0;i<INF;i++){
if(a[i]>a[i+1]){a[i+2]=a[i]-a[i+1];}
if(a[i+1]>a[i]){a[i+2]=a[i+1]-a[i];}
if(a[i+1]==a[i]){gcd=a[i]; break;}}
lcm=a[0]*a[1]/gcd;
cout<<gcd<<" "<<lcm<<endl;}}