#include<iostream>
using namespace std;

long GCD(long a, long b){
	if(b == 0) return a;
	else return GCD(b, a%b);
}

long LCM(long a, long b){
	return a*b / GCD(a, b);
}

int main()
{
	long a,b;
	while(cin >> a >> b){
		cout << GCD(a,b) << " " << LCM(a,b) << endl;
	}
}