#include <iostream>
#include <algorithm>
using namespace std;
long long int gcd(int a,int b) {
  if (a % b == 0) return b;
  else return gcd(b, a % b);
}
int main() {
  long long int a, b;
	while(cin >> a >> b) {
	  cout << gcd(a, b) << " " << (a*b)/gcd(a, b) << endl;
	}
  return 0;
}