#include <iostream>

using namespace std;
long a,b,c[3];
long gcd,lcm;
int main(){
	while(cin >> a >> b){
		c[0] = a;
		c[1] = b;
		c[2] = a;
		while(c[2]>0){
			c[2] = c[0] % c[1];
			c[0] = c[1];
			c[1] = c[2];
		}
		cout << c[0] << ' ' << a/c[0]*b << endl;
	}
	return 0;
}