#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
int a,b,x,y;
float L,xx,yy,xxx;
while(cin>>a>>b){
x=a;y=b;
while(1){
  if(x==y){break;}
  else if(x==0)break;
  else if(y==0)break;
  else if(x<y){y=y-x;x=x-y;}
  else{x=x-y;y=y-x;}
}
xxx=x;
xx=a;yy=b;
L=(xx*yy)/xxx;
cout<<y<<" ";printf("%.0f",L);cout<<endl;
}
  return 0;
}