#include<iostream>
using namespace std;

int main(){
int n,m,a,b,i,N,M;
while(cin>>n>>m){
a=1;
for(i=2;;i++){
N=n%i;
M=m%i;
if(N==0&&M==0){n/=i; m/=i; a*=i; i--;}
if(n<i||m<i)break;}
b=n*m*a;
cout<<a<<" "<<b<<endl;}}