#include <iostream>
using namespace std;

long gcd(long a, long b)
{
	return(b?gcd(b,a%b):a);
}

int main(void)
{
	long long x,y;
	while(cin >> x >> y){
	cout << gcd(x,y) << " " << x*y/gcd(x,y)<< endl;
	}
	return(0);
}