#include <iostream>
using namespace std;

int  gcd(int m, int n);
int lcm(int m,int n);

//?????§??¬?´???°??¨????°???¬?????°????±???????
int main()
{
	int a[50],b[50];
	int set = 0;
	while( cin >> a[set] >> b[set]){
		set++;
	}
	for(int i = 0;i < set; i++){
		cout << gcd(a[i], b[i]) << " " << lcm(a[i], b[i]) << endl;

	}

	return 0;
}

int gcd(int m, int n)
{
	if(0 == m || 0 == n)
		return 0;
	while(m != n){
		if(m > n){
			m = m - n;
		}else {
			n = n - m;
		}
	}
	return m;
}

int lcm(int m,int n)
{
	if(0 == m || 0 == n)
		return 0;
	return ((m / gcd(m, n)) * n);
}