#include <iostream>

using namespace std;

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

int main(){
  int a,b;

  cin >> a >> b;

  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){

  return x/gcd(x,y)*y;

}