#include <iostream>
#include <cmath>

int gcd(int x,int y);
int lcm(int x,int y);

int main(){
  int a,b;
using namespace std;

  while(1){
  cin >> a >> b;
  if(cin.eof())break;
  cout << gcd(a,b)<<" "<<lcm(a,b)<<endl;
  }
  return 0;
}

int gcd(int x,int y){
  int z;
  while(y!=0){
  z = x%y;
  x = y; 
  y = z;
  }
  return x;
}

int lcm(int x,int y){
  int g = gcd(x,y);
  return x/g*y;
}