#include<iostream>
using namespace std;

int g,l;
double a,b,d;

int main()
	{

	while( cin >> a >> b )
		{
			d = a*b;
			while( a != b)
				{
					if( a>b ){ a = a-b; }
					else if( b>a ){ b = b-a; }
				}
				g = (int)a;
				l =  (int)(d/g);
				cout << g <<" "<< l << endl;
		}
		return 0;
	}