#include<iostream>
using namespace std;

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