#include <iostream>
using namespace std;

int gcd(int a,int b){
  if(b > 0) return gcd(b, a % b);
  else return a;
}

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