#include <iostream>
using namespace std;

int gcd(int a,int b){
	if(b<a){
		int temp = b;
		b = a;
		a = temp;
	}
	while(a != 0){
		int temp = a;
		a = b%a;
		b = temp;
	}
	return b;
}

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