#include <iostream>
#include <cstdio>
#include <cstdlib>

using namespace std;


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

int main()
{
	long a, b, d;

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