#include <iostream>
using namespace std;

int solvegcd(int m,int n)
{
	if(n==0){return m;}
	if(m%n==0){return n;}
	else{solvegcd(n,m%n);}
}
int solvelcm(int m,int n)
{
	int mm,nn;
	mm = m/solvegcd(m,n);
	nn = n/solvegcd(m,n);
	return mm*nn*solvegcd(m,n);
}

int main()
{
	int a,b;
	while(cin >> a && cin >> b){
		if(a != max(a,b)){
			int tmp = b;
			b = a;
			a = tmp;
		}
		cout << solvegcd(a,b) << " " << solvelcm(a,b) << endl;
	}
	return 0;
}