#include<iostream>
#include<vector>
using namespace std;
int main(){
  int a,b,c,max=0,min=0,bet,les,ch1,ch2;
  vector<int> ayaku;
  vector<int> byaku;
  while(cin>>a>>b){
    for(int i=1;i<=(a/2);i++){
      if(a%i==0)
	ayaku.push_back(i);
    }
    for(int j=1;j<=(b/2);j++){
      if(b%j==0)
	byaku.push_back(j);
    }
    for(int i=0;i<ayaku.size();i++){
      for(int j=0;j<byaku.size();j++){
	if(ayaku[i]==byaku[j]&&max<byaku[j])
	  max=byaku[j];
      }
    }//?????§??¬?´???°??????
    min=(a/max)*b;
    cout<<max<<" "<<min<<endl;
  }
  return 0;
}