#include <iostream>
#include <stdio.h>

using namespace std;

unsigned long long gcd( unsigned long long a, unsigned long long b)
{
	if( b == 0 ) return a;
	else return gcd( b, a % b );
}
int main(int argc, char const* argv[])
{
	unsigned long long a,b,c;

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