#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  long long int a,b;
  long long int temp,con;
  long long int hk1,hk2;
  while(scanf("%lld %lld",&a,&b)!=EOF){
    if(a>b){
      if(a%b==0){
	hk1=b;
      }else{
	long long int bit=b/2;
	for(long long int i=bit;i>0;i--){
	  if(a%i==0 && b%i==0){
	    hk1=i;
	    break;
	  }
	}
      }
    }else{
      if(b%a==0){
	hk1=a;
      }else{
	long long int dot=a/2;
	for(long long int i=dot;i>0;i--){
	  if(a%i==0 && b%i==0){
	    hk1=i;
	    break;
	  }
	}
      }
    }
    temp=a*b;
    con=temp/hk1;
    hk2=con;
    printf("%lld %lld\n",hk1,hk2);
  }
  return 0;
}