/* All men have limits. They learn what they are and learn
   not to exceed them, I ignore mine. -Batman           */
#include <bits/stdc++.h>
//#include <iostream>
//#include <Windows.h>
using namespace std;
long long int gcd(long long int a,long long int b){
while(1){
	if(a==0)return b;
	b%=a;
	if(b==0)return a;
	a%=b;
}
}

int main(){
long long int a,b;
while(cin>>a>>b)
cout<<gcd(a,b)<<" "<<a*b/gcd(a,b)<<endl;

return 0;
}