#include <iostream>
using namespace std;

int gcd(int a, int b){
  //a < b ユークリッドの互除法
  if(a==0) return b;
  return gcd(b%a,a);
}

//lcm = a*b/gcd
int main(){
  int a,b;
  while(cin >> a >> b){
    int g = gcd(a,b);
    cout << g << " " << a*b/g;
  }
  return 0;
}